async-oneshot-0.3.0 has been yanked.
async-oneshot
A fast and small async-aware oneshot channel.
Features:
- Sender may wait for a receiver to be waiting.
- Fast and small, with easy to understand code.
- Only two dependencies, both mine and with no deps.
- Complete
no_std
support (withalloc
forArc
).
Usage
Performance
Crap numbers from my shitty 2015 macbook pro:
test create ... bench: 122 ns/iter (+/- 12)
test create_send ... bench: 122 ns/iter (+/- 21)
test create_send_recv ... bench: 126 ns/iter (+/- 8)
test create_wait_send_recv ... bench: 232 ns/iter (+/- 29)
The measurement overhead seems to be a huge part of these times.
Note on safety
Yes, this crate uses unsafe. 10 times. Not all of it is performance gaming. Please audit carefully!
See Also
- async-oneshot-local (single threaded)
- async-channel (MPMC)
Copyright and License
Copyright (c) 2020 James Laver, async-oneshot contributors.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.