Closed rkeely closed 1 month ago
Extending individual events requires duplicating a lot of the functionality within the individual events and it makes these mutable.
I was looking more for an approach where we extend the recording/publishing infrastructure. In particular:
Event getSource()
to RecordableEvent
and make RecordableEvent extends Event
JfrRecordableEvent
and rework NoOpEventRecorder
to create an event instanceEventBus
(e.g. EventRecorder.RecordableEvent event = …;
later: eventBus.publish(event)
.JfrEventRecorder.publish(…)
to check whether the given event is EventRecorder.RecordableEvent
. If so, then we call record(…)
on the event instead of jdk.jfr.Event jfrEvent = createEvent(…);
DefaultEventBus
to unwrap EventRecorder.RecordableEvent
before emitting the event Sorry that I deleted my PR branch while doing some rebase. I have created a new PR https://github.com/redis/lettuce/pull/2859. Let's continue the discussion in the new one
Publish TopologyRefreshEvent to event bus #2809
Update: 2024-04-07
Only include interface change to get a sense of direction before larger change.
Some reasoning:
DurationalEvent
to capture the traits of event thats not ephemeral or instantaneous. I didn't reuse the Event interface because most of events that implements it are instantaneous and I don't want them to carry traits that could indicate anything that's related to duration.EventRecorder
to explicitly handle dual publishing (recording with recorder and publishing with event bus or only recording). This seems to be the most straight forward and I am also open to creating a new wrapper class for dual publishing only.TopologyRefreshEvent
as I suspect there are many people subscribing to it from EventBus already. I am also open to create new events class dedicated for the start and end for topology refresh operation.Make sure that:
[ ] You submit test cases (unit or integration tests) that back your changes.