Re: Replicator as Event Handler or Event Producer

58 views
Skip to first unread message

Michael Barker

unread,
Apr 8, 2018, 6:35:13 PM4/8/18
to lmax-di...@googlegroups.com
An event handler can be an event producer.  Typically it will produce events for a different Disruptor instance.  This is quite common (we use it a lot in our services).

You "can" produce events for the same Disruptor instance, but you need to be careful as it is possible to create a dead lock when doing this.  E.g. if the ring buffer is full and the event handler tries to publish to itself and blocks until there is space it will become stuff and messages won't progress.

Mike.

On 6 April 2018 at 23:20, Narges Khoshdel <m.khoshd...@gmail.com> wrote:
Hello,

My question is about designing a replicator.
Firstly I thought that replicator implements eventHandler class and in the onEvent method it puts event on replica, but when I wanted to implement this scenario I understood that we cannot do this because eventProducer should publish data into ringBuffer and eventHandler cannot work as an eventProducer.
So I want to ask that how can I implement a replicator?

Thanks,
Narges

--
You received this message because you are subscribed to the Google Groups "Disruptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmax-disruptor+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages