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

Add Channel.CreateUnboundedPrioritized #100550

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

stephentoub
Copy link
Member

Fixes #62761

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Member

@adamsitnik adamsitnik left a 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.

Assert.Equal(21, p.Age);
Assert.Equal(1, c.Reader.Count);

Assert.True(c.Reader.TryRead(out p));
Copy link
Member

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);
}

@adamsitnik adamsitnik merged commit b7c3446 into dotnet:main Apr 15, 2024
87 checks passed
@adamsitnik adamsitnik added this to the 9.0.0 milestone Apr 15, 2024
@stephentoub stephentoub deleted the channelpriority branch April 19, 2024 02:42
@stephentoub
Copy link
Member Author

Thanks, @adamsitnik.

matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal] Channel.CreateUnboundedPrioritized
2 participants