Skip to content

Conversation

@tisonkun
Copy link
Collaborator

This is derived from https://github.com/faern/oneshot/.

Special thanks to @faern and @Cassy343 for the original work. I made my own for mea, since mea needs not support synchronized receiving functions. And this can simplify the code a lot.

  1. Receiver::drop no longer needs to handle RECEIVING or AWAKING state. Because only try_recv avaialble and any RECEIVING state would only happen on the Recv future.
  2. Reuse the same busy loop logic for Recv when handling AWAKING state in a poll.

This also make use of the patch faern/oneshot#61 and I suppose that it provides a better impl for implementing Recv as a future, rather than under the name AsyncReceiver and thus no async_channel.

Other refs -

tisonkun added 2 commits May 30, 2025 18:07
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already invariant due to UnsafeCell<T>.

@tisonkun tisonkun merged commit 1263aa8 into main May 30, 2025
9 checks passed
@tisonkun tisonkun deleted the oneshot branch May 30, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants