Even if correctness and API niceness is the most important, speed is what sells :)
Write benchmarks that performs some common channel operations and compare the times between oneshot and a number of other popular channels. Of course good to compare with other oneshot channel types, but since normal channels can be used for single messages it makes sense to compare with those as well
std::sync::mpsc::channel() - Is not locked to be oneshot only. But it has a special oneshot mode active until the channel is used for multiple messages.
Oneshot channels
futures::channel::oneshot::channel() - has try_recv otherwise can only receive async.
tokio::sync::oneshot::channel - has try_recv otherwise can only receive async.
Other channels it might make sense to compare with
Even if correctness and API niceness is the most important, speed is what sells :)
Write benchmarks that performs some common channel operations and compare the times between
oneshot
and a number of other popular channels. Of course good to compare with other oneshot channel types, but since normal channels can be used for single messages it makes sense to compare with those as wellstd::sync::mpsc::channel()
- Is not locked to be oneshot only. But it has a special oneshot mode active until the channel is used for multiple messages.Oneshot channels
futures::channel::oneshot::channel()
- hastry_recv
otherwise can only receive async.tokio::sync::oneshot::channel
- hastry_recv
otherwise can only receive async.Other channels it might make sense to compare with
crossbeam_channel::bounded(1)
async_std::sync::channel(1)