上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 119 下一页
摘要: 环境 Time 2022-01-12 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/sync/oneshot/index.html oneshot 可以实现单对单的消息通信,不过只能通信一次。 示例 main.rs 阅读全文
posted @ 2022-03-30 09:35 jiangbo4444 阅读(221) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-12 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/io/struct.Stdout.html 示例 main.rs use tokio::io::{self, AsyncBufRe 阅读全文
posted @ 2022-03-30 09:34 jiangbo4444 阅读(234) 评论(0) 推荐(0)
摘要: 环境 kubernetes 1.20.6 Spring Boot 2.5.0-RC1 目标 之前已经了解过 Secret 了,并且创建 Opaque 类型的 Secret。除了之前创建的类型,还有 tls 的类型。 示例 准备私钥和证书 之前已经生成了服务器的证书和私钥,如下: [root@mast 阅读全文
posted @ 2022-03-30 09:31 jiangbo4444 阅读(1089) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/time/index.html 示例 interval use std::{io, thread, time::Duration} 阅读全文
posted @ 2022-03-30 09:21 jiangbo4444 阅读(381) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/time/index.html 标准库和 Tokio 都提供了线程休眠函数 sleep,标准库的休眠会挂起线程,不做任何事。而 T 阅读全文
posted @ 2022-03-30 09:19 jiangbo4444 阅读(825) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/task/index.html 示例 正常结果 use std::{io, thread}; #[tokio::main] asy 阅读全文
posted @ 2022-03-30 09:18 jiangbo4444 阅读(330) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/time/index.html 示例 timeout use std::io; use tokio::time::{self, D 阅读全文
posted @ 2022-03-30 09:17 jiangbo4444 阅读(616) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/task/index.html 运行阻塞任务可以有两种选择,spawn_blocking 和 block_in_place。前面说 阅读全文
posted @ 2022-03-30 09:16 jiangbo4444 阅读(372) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/time/struct.Instant.html 示例 main.rs use std::{io, time::Duration} 阅读全文
posted @ 2022-03-30 09:15 jiangbo4444 阅读(133) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/signal/index.html Tokio 可以异步接收系统传递的信号。 示例 main.rs 按下 ctrl-c 时,程序结 阅读全文
posted @ 2022-03-30 09:14 jiangbo4444 阅读(173) 评论(0) 推荐(0)
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 119 下一页