promiser 0.0.5

promise sync primitive
Documentation
  • Coverage
  • 19.23%
    5 out of 26 items documented0 out of 19 items with examples
  • Size
  • Source code size: 10.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 492.3 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • viperscape/rust-promise
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • viperscape

rust-promise

for now use the git dependency in your Cargo.toml:

[dependencies.promise]



git = "https://github.com/viperscape/rust-promise.git"

example usage:

extern crate promise;
use promise::Promise;
use std::rand;

fn main () {
    let (pt,pr) = Promise::new();
    let bd = vec![rand::random::<u64>();1000];
    pt.deliver(bd);
    let v = pr.with(|x| x[999]); //copy value, returns inside of Result
    println!("{:?}",v); //Ok(3654177790282180513)
}

benchmarks

These represent some basic benchmarking, real speeds could vary significantly.

test latch::tests::bench_latch            ... bench:        45 ns/iter (+/- 0)
test promise::tests::bench_channel_linear ... bench:       758 ns/iter (+/- 7)
test promise::tests::bench_promise_linear ... bench:         1 ns/iter (+/- 0)