Send a value synchronously and asynchronously wait for it. Catty is faster, simpler, and more lightweight than
futures::oneshot
, which is slightly more flexible.
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]