-
Notifications
You must be signed in to change notification settings - Fork 593
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
Align Reject with Ack/Nack #1642
Conversation
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.
Good catch
I wonder if the split between ValueTask and Task makes sense at all here, I could not really find any async methods doing the if(valueTask.IsCompletedSuccessfully)
{
return FastPath();
}
else
{
return SlowAwaitPath();
} dance, or anything in a really tight loop where the above should be used. |
@Tornhoof I commented on the umbrella issue that I'm not sure if the valuetask vs task has further been thought through. Currently the entire Channel -> Session -> Connection -> Frame -> ChannelWriter exposes the underlying channelwriter value task and that is a choice that I think is fine. What is confusing right now is that are public APIs that are essentially doing ValueTask all the way through the hierarchy while others don't. This PR does at least align the methods that call into ModelSendAsync |
For example I also do not understand why when |
If there are other changes you suggest, feel free to point them out and I'll take a look, or open new PRs. It has been a while since I looked at this in detail, but I remember trying to avoid conversion from ValueTask -> Task. |
There's no good reason that I can see! Feel free to make a list and I can address this. I'll open an issue to track this. UPDATE: #1645 |
Proposed Changes
See #1413 (comment)
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.