-
Notifications
You must be signed in to change notification settings - Fork 598
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
8.0: improve eventing #986
Conversation
Looks good. Have yet to read a bit more in-depth. Would be good to add a test that hammers add/remove events while also invoking them to see if any race conditions happen due to the caching. Impressive speed boost :) this should be back-portable to 6.2 right? |
using System.Threading.Tasks; | ||
|
||
namespace RabbitMQ.Client.Events | ||
{ | ||
public delegate Task AsyncEventHandler<in TEvent>(object sender, TEvent @event) where TEvent : EventArgs; |
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.
This is a public API change, but it slips through the APIApproval test. 🙄
(I removed it as the EventHandler doesn't have it either (used to have it before 4.0 I think))
Also removing should be "fine" as it only makes it less strict => no recompilation errors AFAIK
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.
Since this is for 7.0, we can certainly make this change.
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.
If we want to backport it to 6.x and this is an issue, one could add it back (and to AsyncEventingWrapper) for 6.x
Valid point. Question is how could we set up a test for this that actually is verifyable? I'll think about it.
Yes, no public API (except see single comment) was changed. Also might worth mentioning here:
|
I've added a test case about adding event handlers in a concurrent environment and testing whether all of them are called. 👍 |
Can this be merged? Regarding backport to 6.x and the removal of
|
This also needs a separate version for
so we need to decide to bump the target language version. This means requiring .NET Core 3.x and Standard 2.1 which could be reasonable for |
We can also just get rid of the nullable reference types feature for the backport. It's not a necessity. |
That works for me, I suspect that earlier master changes will have to be backported or we will keep making every master PR a special case for |
As said in the other PR =>
|
@michaelklishin Any answer for this? |
Since we haven't found any obvious improvements for #959 to ship in |
I personally vote for shipping |
I was under the impression 7.0 was for smaller interface changes like #959 and 8.0 was the full async client. I'd argue that all changes on master so far still qualifies as "smaller interface changes" and thus should be released with 7.0. If we manage to fix 959 as part of it, the better, otherwise it will be fixed by the full async client for sure in 8.0. I had another idea today while I thought about it again, so if successful, I may draft a PR for it. |
We can change the milestone for |
Proposed Changes
Changes the eventing used in this lib to use the new EventingWrapper. The main benefit is that the delegates are cached after the first invocation.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
Local output of new benchmarks
Eventing_AddRemove:
Eventing_Invoke: