I'm trying to write a wrapper for the LMAX disruptor, and I'm wondering if there is a mechanism to add an event handler that executes at the end of the disrupter's flow.
Is there a way to do this?
I'm trying to write a wrapper for the LMAX disruptor, and I'm wondering if there is a mechanism to add an event handler that executes at the end of the disrupter's flow.
Is there a way to do this?
The disruptor being analogous to a queue, there is no 'end' really. It's not like finite streams in reactive programing.
The publisher would be in charge of flagging the last event (you could have a boolean field in the event class just for that). It's the "poison record" technique.
You would have a handler that only performs when the flag is true. That's all.