All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added: for new features.
- Changed: for changes in existing functionality.
- Deprecated: for soon-to-be removed features.
- Removed: for now removed features.
- Fixed: for any bug fixes.
- Security: in case of vulnerabilities.
- Change how loom concurrency testing is triggered. To get rid of
loom
in the dependency treeoneshot
pulls in, it has in addition to being gated behindcfg(oneshot_loom)
also been made an optional dependency. This makes this library way smaller for downstream consumers. This has the downside that the crate now exposes aloom
feature. DOWNSTREAM USERS ARE NOT SUPPOSED TO EVER ENABLE THIS. No stability or semver guarantees exist around theloom
feature. This change ultimately makes no difference for any user ofoneshot
in regular usage.
- Add
is_closed
method to theSender
.
- Add
into_raw
andfrom_raw
methods on bothSender
andReceiver
. Allows passingoneshot
channels over FFI without an extra layer of heap allocation.
- Handle the UNPARKING state correctly in all recv methods.
try_recv
will now not panic if used on aReceiver
that is being unparked from an async wait. The otherrecv
methods will still panic (as they should), but with a better error message.
- Upgrade to Rust edition 2021. Also increases the MSRV to Rust 1.60.
- Add null-pointer optimization to
Sender
,Receiver
andSendError
. This reduces the call stack size of Sender::send and it makesOption<Sender>
andOption<Receiver>
pointer sized (#18). - Relax the memory ordering of all atomic operations from
SeqCst
to the most appropriate lower ordering (#17 + #20).
- Fix undefined behavior due to multiple mutable references to the same channel instance (#18).
- Fix race condition that could happen during unparking of a receiving
Receiver
(#17 + #20).
- Keep the last
Waker
inFuture::poll
, not the first one. Stops breaking the contract on how futures should work.
- Fix unreachable code panic that happened if the
Receiver
of an empty but open channel was polled and then dropped.
Initial implementation. Supports basically all the (for now) intended functionality.
Sender is as lock-free as I think it can get and the receiver can both do thread blocking
and be awaited asynchronously. The receiver also has a wait-free try_recv
method.
The crate has two features. They are activated by default, but the user can opt out of async
support as well as usage of libstd (making the crate no_std
but still requiring liballoc)
Name reserved on crate.io by someone other than the author of this crate.