Comprehensive Rust(繁体中文)
Futures Future 是一種特徵,物件實作這種特徵時,代表作業或許尚未完成。Future 可供輪詢,而 poll 會傳回 Poll。 use std::pin::Pin; use std::task::Context; pub trait Future { type Output; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Tokio:效能良好,具有完善的功能生態系統,例如適用於 HTTP 的 Hyper,或適用於 gRPC 的 Tonic。 • async-std:目標是成為「async 的 std」,並在 async::task 中含有基本執行環境。 • smol:簡單輕量 許多大型應用程式都有專屬的執行環境。例如,Fuchsia 已有一個執行環境。 • 請注意,在列出的執行環境中,Rust Playground 只支援 { println!("Count in task: {i}!"); time::sleep(time::Duration::from_millis(5)).await; } } async fn main() { tokio::spawn(count_to(10)); for i in 1..5 { println!("Main task: {i}"); time::sleep(t0 码力 | 358 页 | 1.41 MB | 10 月前3julia 1.10.10
. . . . . . . . . . . 290 22 Parallel Computing 292 23 Asynchronous Programming 293 23.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 23.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 23.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 23.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 24.10 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 24.11 Safe0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.10.9
. . . . . . . . . . . 290 22 Parallel Computing 292 23 Asynchronous Programming 293 23.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 23.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 23.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 23.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 24.10 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 24.11 Safe0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.11.4
. . . . . . . . . . . 308 23 Parallel Computing 310 24 Asynchronous Programming 311 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 25.9 Safe0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.11.5 Documentation
. . . . . . . . . . . 308 23 Parallel Computing 310 24 Asynchronous Programming 311 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 25.9 Safe0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.11.6 Release Notes
. . . . . . . . . . . 308 23 Parallel Computing 310 24 Asynchronous Programming 311 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 25.9 Safe0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.12.0 Beta3
. . . . . . . . . . . 311 23 Parallel Computing 313 24 Asynchronous Programming 314 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.9 Safe0 码力 | 2057 页 | 7.44 MB | 3 月前3Julia 1.12.0 RC1
. . . . . . . . . . . 311 23 Parallel Computing 313 24 Asynchronous Programming 314 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.9 Safe0 码力 | 2057 页 | 7.44 MB | 3 月前3Julia 1.12.0 Beta4
. . . . . . . . . . . 311 23 Parallel Computing 313 24 Asynchronous Programming 314 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 24.4 Tasks and events Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.9 Safe0 码力 | 2057 页 | 7.44 MB | 3 月前3julia 1.13.0 DEV
. . . . . . . . . . . 311 23 Parallel Computing 313 24 Asynchronous Programming 314 24.1 Basic Task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 24.2 Communicating Communicating with Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 24.3 More task operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319CONTENTS v 24.4 Tasks Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.8 Task Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 25.9 Safe0 码力 | 2058 页 | 7.45 MB | 3 月前3
共 35 条
- 1
- 2
- 3
- 4