https://github.com/limpix31/onetime
Onetime (aka. oneshot) spsc async channel
https://github.com/limpix31/onetime
async concurrency mpsc rust rust-lang spsc
Last synced: about 2 months ago
JSON representation
Onetime (aka. oneshot) spsc async channel
- Host: GitHub
- URL: https://github.com/limpix31/onetime
- Owner: LIMPIX31
- License: apache-2.0
- Created: 2024-05-20T14:23:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-21T10:42:07.000Z (about 1 year ago)
- Last Synced: 2025-03-24T13:05:29.690Z (2 months ago)
- Topics: async, concurrency, mpsc, rust, rust-lang, spsc
- Language: Rust
- Homepage: https://crates.io/crates/onetime
- Size: 11.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# onetime
An async onetime (aka. oneshot) channel, where you can send only one message over that channel.
## Examples
```rust
let (s, r) = onetime::channel();s.send("ok")?;
let value = r.recv().await?;
```## License
Licensed under either of
* Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)at your option.