the usage of endOfBatch in EventHandler -> onEvent(event, long sequence, boolean endOfBatch)a

171 views
Skip to first unread message

Zhen Li

unread,
Jun 25, 2019, 12:14:18 AM6/25/19
to Disruptor
Hi, 

Is using of endOfBatch optional? If not, will the event be processed again when endOfBatch is false? 

Michael Barker

unread,
Jun 25, 2019, 12:26:29 AM6/25/19
to lmax-di...@googlegroups.com
Hi,

You don't need to use endOfBatch, it is there to help those who want to optimise their event handlers, e.g. if you are doing file I/O you could store all of the events in memory until endOfBatch is true and write the data to the underlying storage then.  Events won't be processed a second time.

Mike.

On Tue, 25 Jun 2019 at 16:14, Zhen Li <zhl...@gmail.com> wrote:
Hi, 

Is using of endOfBatch optional? If not, will the event be processed again when endOfBatch is false? 

--
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-disrupto...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/lmax-disruptor/7b1a2830-baef-46e1-bb6b-814e793ba693%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhen Li

unread,
Jun 25, 2019, 10:35:26 AM6/25/19
to Disruptor
Thank you, Mike!

I am using disruptor to replace the BlockingQueue in my application for speeding up the throughput. So excited that it did work a lot better!
Reply all
Reply to author
Forward
0 new messages