Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Async multi-producer multi-consumer channel

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

smol-rs/async-channel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildLicenseCargoDocumentation

An async multi-producer multi-consumer channel, where each message can be received by onlyone of all existing consumers.

There are two kinds of channels:

  1. Bounded channel with limited capacity.
  2. Unbounded channel with unlimited capacity.

A channel has theSender andReceiver side. Both sides are cloneable and can be sharedamong multiple threads.

When allSenders or allReceivers are dropped, the channel becomes closed. When achannel is closed, no more messages can be sent, but remaining messages can still be received.

The channel can also be closed manually by callingSender::close() orReceiver::close().

Examples

let(s, r) = async_channel::unbounded();assert_eq!(s.send("Hello").await,Ok(()));assert_eq!(r.recv().await,Ok("Hello"));

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you, as defined in the Apache-2.0 license, shall bedual licensed as above, without any additional terms or conditions.

About

Async multi-producer multi-consumer channel

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors24

Languages


[8]ページ先頭

©2009-2025 Movatter.jp