feat: add README.md
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
Import `tokio`:
|
||||
|
||||
```
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
```
|
||||
|
||||
Usage:
|
||||
|
||||
```rust
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// TODO ...
|
||||
}
|
||||
```
|
||||
|
||||
`tokio` 提供以下几种 channels 类型:
|
||||
|
||||
* mpsc: 多生产者,单消费者 - https://docs.rs/tokio/1/tokio/sync/mpsc/index.html
|
||||
* oneshot: 单生产者,单消费者 - https://docs.rs/tokio/1/tokio/sync/oneshot/index.html
|
||||
* broadcast: 多生产者,多消费者 - https://docs.rs/tokio/1/tokio/sync/broadcast/index.html
|
||||
* watch: 单生产者,多消费者 - https://docs.rs/tokio/1/tokio/sync/watch/index.html
|
||||
|
||||
Reference in New Issue
Block a user