Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: oneshot::Receiver::is_closed() #7154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Feb 13, 2025

this commit introduces a new method to
tokio::sync::oneshot::Receiver<T>.

this method returns true if the channel is closed. this is similar to the existing
tokio::sync::mpsc::UnboundedReceiver::is_closed() and tokio::sync::mpsc::Receiver::is_closed() methods.

see:

this commit introduces a new method to
`tokio::sync::oneshot::Receiver<T>`.

this method returns true if the channel is closed.

this is similar to the existing
`tokio::sync::mpsc::UnboundedReceiver::is_closed()` and
`tokio::sync::mpsc::Receiver::is_closed()` methods.

see:
* https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Receiver.html#method.is_closed
* https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.UnboundedReceiver.html#method.is_closed
* tokio-rs#7137 (comment)

Signed-off-by: katelyn martin <[email protected]>
@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Feb 13, 2025
@cratelyn
Copy link
Contributor Author

there are still some open questions about the semantics of this method. see in particular, this thread of discussion from #7137.

@cratelyn
Copy link
Contributor Author

i see issues in ci at the moment, but i am marking this as ready for review because i believe these errors to be unrelated.

⚠️ Failed to start an instance: INVALID_ARGUMENT: Not Found 404 Not Found
POST [https://compute.googleapis.com:443/compute/v1/projects/cirrus-ci-community/zones/us-central1-c/instances](https://compute.googleapis.com/compute/v1/projects/cirrus-ci-community/zones/us-central1-c/instances)

@cratelyn cratelyn marked this pull request as ready for review February 13, 2025 20:52
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants