上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 111 下一页
摘要: 环境 Time 2022-01-12 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/sync/index.html mpsc 可以实现多对一的消息通信,表示:Multi-producer, single-consu 阅读全文
posted @ 2022-03-30 09:36 jiangbo4444 阅读(152) 评论(0) 推荐(0)
摘要: 环境 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 阅读(215) 评论(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 阅读(224) 评论(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 阅读(1080) 评论(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 阅读(367) 评论(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 阅读(802) 评论(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 阅读(322) 评论(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 阅读(607) 评论(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 阅读(363) 评论(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 阅读(128) 评论(0) 推荐(0)
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 111 下一页