-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Semaphore example using an Arc<Semaphore> for semaphore passing #5956
Semaphore example using an Arc<Semaphore> for semaphore passing #5956
Conversation
Your branch is behind #5939, which has already been merged. Would you be able to update your branch to latest master? You should be able to do this by merging master into your branch and fixing the resulting conflicts. |
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
@Darksonn I think the event handler loop in the updated example is causing issues with CI. The test suite has been running for 30 minutes so far, and I can't find a way to cancel the workflows. Would you be able to stop it? Workflow: https://github.com/tokio-rs/tokio/actions/runs/6014142339 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is looking pretty good. The example could use a few more comments on the semaphore-related stuff.
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
…aphore-example-file # Conflicts: # tokio/src/sync/semaphore.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good. I have a few comments to simplify the language a bit.
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
@Darksonn Thank you for the suggestions. This looks much more concise and focused than what I had begun with; and I've learned a few things about technical writing by reflecting on them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these suggestions are the last ones. Then I'm happy to merge this.
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me.
@Darksonn Merged latest commits from upstream. Would this be able to be merged? |
Sorry, seems like I forgot to press the button. |
A simple example of limiting request processing using a task-safe semaphore and demonstrating
acquire_owned
for: #5933