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

Event args cancellation #1683

Merged
merged 12 commits into from
Sep 19, 2024
Merged

Conversation

danielmarbach
Copy link
Collaborator

@danielmarbach danielmarbach commented Sep 18, 2024

Proposed Changes

This introduces the possibility to allow the cancellation to flow into the async event handlers

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.

@danielmarbach
Copy link
Collaborator Author

@lukebakken I started implementing the cancellation support into the event handler wrapper. This is far from done but here is a headsup

@danielmarbach
Copy link
Collaborator Author

FYI I did not setup the commit signing on my temporary device while my main macbook is on repair. That is why some commits are not signed

@lukebakken lukebakken self-assigned this Sep 18, 2024
@lukebakken lukebakken self-requested a review September 18, 2024 21:02
@lukebakken lukebakken added this to the 7.0.0 milestone Sep 18, 2024
@danielmarbach danielmarbach force-pushed the event-args-cancellation branch from cd18802 to 4be0367 Compare September 19, 2024 09:19
@danielmarbach danielmarbach marked this pull request as ready for review September 19, 2024 09:19
@danielmarbach
Copy link
Collaborator Author

I will double-check things once more, but I guess it doesn't hurt start reviewing it

@danielmarbach
Copy link
Collaborator Author

danielmarbach commented Sep 19, 2024

@lukebakken do you know why AsyncEventingWrapper is a struct? Seems unnecessary because we use them as fields on objects that don't get allocated a ton. It appears to be unnecessarily complex and require comments like

// Do not make this function async! (This type is a struct that gets copied at the start of an async method => empty _handlers is copied)

for little value unless I'm missing something

@lukebakken
Copy link
Contributor

I can look in the commit history. The choice of struct for the event wrappers came from a community-contributed PR, most likely from @bollhals or @stebet

I'm perfectly happy changing them to class for the reasons you stated.

@danielmarbach
Copy link
Collaborator Author

Those are two pretty smart blokes. I don't want to jump the gun ;)

@lukebakken
Copy link
Contributor

FYI, I'm addressing the TODO you added around ShutdownEventArgs in a branch that depends on this one. I'm also finally fixing the directory structure so that it matches the namespaces, because that has driven me nuts for years.

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.

Thank you yet again @danielmarbach

@lukebakken lukebakken merged commit 9dab7bc into rabbitmq:main Sep 19, 2024
11 checks passed
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.

2 participants