ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2k stars 579 forks source link

Fixes #3169 : Track event listeners keyed by type to allow earlier event firing veto #3170

Open chrisdennis opened 1 year ago

SamuelBussmann commented 1 year ago

Thank you for the fix. But doesn't InvocationScopedEventSink.fireOrdered still block on all events if any ordered listener was registered? Maybe skip events without interested listeners and just consume the queue entry?

chrisdennis commented 1 year ago

Thank you for the fix. But doesn't InvocationScopedEventSink.fireOrdered still block on all events if any ordered listener was registered? Maybe skip events without interested listeners and just consume the queue entry?

@SamuelBussmann you're right... we should be able to pull this higher and eliminate a lot more work. Let me move this back to draft and until I get time to rework it.

SamuelBussmann commented 1 year ago

@SamuelBussmann you're right... we should be able to pull this higher and eliminate a lot more work. Let me move this back to draft and until I get time to rework it.

Just add a filter, whether any listener is interested in this event at all? That should keep most of the events from even getting created. And then a further optimization would be to group events by ordered listener to let the other events get past. But this will get tricky fast with Listeners implementing multiple events...