-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add Channel.CreateUnboundedPrioritized #100550
Conversation
Note regarding the
|
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, thank you @stephentoub
I've found some minor nits, but since you are OOF and this PR needs to be merged for P4 I am going to merge it right away.
src/libraries/System.Threading.Channels/src/System/Threading/Channels/Channel.netcoreapp.cs
Show resolved
Hide resolved
Assert.Equal(21, p.Age); | ||
Assert.Equal(1, c.Reader.Count); | ||
|
||
Assert.True(c.Reader.TryRead(out p)); |
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.
nit: this logic could be moved to a helper method to avoid copying the code
private static void ReadNext(Channel<Person> c, int expectedAge, int expectedCount)
{
Assert.True(c.Reader.TryRead(out p));
Assert.Equal(expectedAge, p.Age);
Assert.Equal(expectedCount, c.Reader.Count);
}
Thanks, @adamsitnik. |
Fixes #62761