2

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?

Omar Kooheji
  • 54,530
  • 68
  • 182
  • 238

1 Answers1

0

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.

user2023577
  • 1,752
  • 1
  • 12
  • 23