catty 0.1.4

Send and await a value asynchronously
Documentation

catty

a picture of a slingshot

Send a value synchronously and asynchronously wait for it. Catty is faster, simpler, and more lightweight than futures::oneshot, which is slightly more flexible.

Example

let (tx, rx) = catty::oneshot();
tx.send("Hello!");
assert_eq!(rx.await, Ok("Hello!"));

Benchmarks

To run the benchmarks with Criterion, simply do cargo bench. On my machine, the results are as follows:

create-futures          time:   [105.43 ns 105.52 ns 105.61 ns]
create-catty            time:   [47.774 ns 47.808 ns 47.843 ns]
oneshot-futures         time:   [195.77 ns 195.88 ns 196.01 ns]
oneshot-catty           time:   [134.70 ns 134.80 ns 134.91 ns]