上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 119 下一页
摘要: 环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html Tokio 除了是一个异步运行时外,还提供了其它方面的功能,可以进行开启。 阅读全文
posted @ 2022-02-27 21:55 jiangbo4444 阅读(129) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html handle 方法返回一个可以执行任务的句柄。 示例 main.rs us 阅读全文
posted @ 2022-02-27 21:54 jiangbo4444 阅读(110) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html enter 方法可以进入异步运行时的上下文。 示例 main.rs use 阅读全文
posted @ 2022-02-27 21:54 jiangbo4444 阅读(144) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html spawn_blocking 方法可以接收一个闭包,可以是一个阻塞任务。 阅读全文
posted @ 2022-02-27 21:53 jiangbo4444 阅读(549) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html block_on 方法可以接收一个异步任务,在当前线程中运行并阻塞直到完成 阅读全文
posted @ 2022-02-27 21:52 jiangbo4444 阅读(202) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html shutdown_background 方法可以立即关闭运行时,不会产生阻 阅读全文
posted @ 2022-02-27 21:52 jiangbo4444 阅读(146) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html shutdown_timeout 方法关闭运行时会阻塞,等待任务完成。参数 阅读全文
posted @ 2022-02-27 21:51 jiangbo4444 阅读(204) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html spawn 方法可以接收一个异步任务,在工作线程中运行,并不产生阻塞。 示 阅读全文
posted @ 2022-02-27 21:50 jiangbo4444 阅读(199) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-10 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html Tokio 是 Rust 的一个异步运行时库,提供了标准库的异步版本,Ru 阅读全文
posted @ 2022-02-27 21:50 jiangbo4444 阅读(151) 评论(0) 推荐(0)
摘要: 环境 Time 2022-01-08 Rust 1.57.0 mio 0.8 概念 参考:https://github.com/tokio-rs/mio/blob/master/examples/tcp_server.rs 将客户端发送的消息转为大写后返回。 UDP 服务器基本功能实现完成,只能做练 阅读全文
posted @ 2022-02-26 21:19 jiangbo4444 阅读(157) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 119 下一页