Skip to content

sorted message-based communication channel in Rust

License

Apache-2.0, MIT licenses found

Licenses found

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

kczimm/sorted-channel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sorted-channel

codecov

A multi-producer, multi-consumer channel that outputs sorted messages. Each message is received by only one receiving channel.

Examples

use sorted_channel::sorted_channel;
use std::thread;

let (tx, rx) = sorted_channel();

let handle = thread::spawn(move || {
    for i in [0, 9, 1, 8, 2, 7, 3, 6, 4, 5] {
        tx.send(i).unwrap();
    }
});

handle.join().unwrap();

for i in (0..10).rev() {
    assert_eq!(rx.recv(), Ok(i));
}

License

Licensed under either of

at your option.

Contribution

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

About

sorted message-based communication channel in Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages