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

Align Reject with Ack/Nack #1642

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

danielmarbach
Copy link
Collaborator

@danielmarbach danielmarbach commented Jul 30, 2024

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 apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the 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.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further 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.

@lukebakken lukebakken self-assigned this Jul 30, 2024
@lukebakken lukebakken added this to the 7.0.0 milestone Jul 30, 2024
Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@Tornhoof
Copy link
Contributor

Tornhoof commented Jul 30, 2024

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.

@danielmarbach
Copy link
Collaborator Author

@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

@danielmarbach
Copy link
Collaborator Author

For example I also do not understand why when WriteAsync on the framehandler is returning a value task the corresponding SendProtocolHeaderAsync is not

@lukebakken
Copy link
Contributor

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.

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.

@lukebakken
Copy link
Contributor

lukebakken commented Jul 30, 2024

For example I also do not understand why when WriteAsync on the framehandler is returning a value task the corresponding SendProtocolHeaderAsync is not

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

@lukebakken lukebakken merged commit db5bc23 into rabbitmq:main Jul 30, 2024
11 checks passed
@danielmarbach danielmarbach deleted the value-task branch July 30, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants