-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🐇 Implement AsyncQueue<T>.TryDequeueAsync #43440
Conversation
4aac73d
to
d6b23fb
Compare
67843f4
to
561f076
Compare
{ | ||
return completedEvent; | ||
// When the queue is completed with a pending TryDequeueAsync return then |
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.
When the queue is completed with a pending TryDequeueAsync return then [](start = 35, length = 70)
I find this wording confusing, consider rewording.
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 amended the previous commit just to reword this. The difference can be seen in this:
https://github.com/dotnet/roslyn/compare/561f07655fc1c829a0948546691867533051739c..2043e01430be991df037cb94d9f1b4b0fd8713e7
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.
LGTM (iteration 1)
This method uses Optional<T> instead of T for the return value of TryDequeueAsync, allowing the method to support normal termination of the queue without throwing cancellation exceptions.
561f076
to
2043e01
Compare
@dotnet/roslyn-compiler for a second review |
@gafter can you take a look at this? |
// the Optional<T> will not have a value. This signals the queue has reached | ||
// completion and no more items will be added to it. | ||
|
||
// This failure is being tracked by https://github.com/dotnet/roslyn/issues/5962 |
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.
This failure is being tracked by [](start = 35, length = 32)
This comment appears pretty out of date. Can this assertion be uncommented? At the very least we should have an open issue tracking this potential failure.
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'll submit this as a follow-up
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.
This method uses
Optional<T>
instead ofT
for the return value of TryDequeueAsync, allowing the method to support normal termination of the queue without throwing cancellation exceptions.