re: How can I have one class with multiple EventHandlers<>

85 views
Skip to first unread message

samra...@gmail.com

unread,
Aug 10, 2018, 3:25:39 PM8/10/18
to Disruptor
I have a class which needs to handle multiple events of Type1, Type2, Type3.
The EventHandler<T> only works for one type.
Is there a way to have a single object handle multiple handlers.

e.g.: 
SomeClass implements EventHandler<Type1, Type2, Type3>, LifecycleAware {
onEvent(Type1, ...)
onEvent(Type2, ...)
onEvent(Type3, ...)
}


Michael Barker

unread,
Aug 10, 2018, 9:01:41 PM8/10/18
to lmax-di...@googlegroups.com
How are you expecting to receive these events?  All from the same ring buffer or 3 separate ring buffers?

Mike.

--
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.
For more options, visit https://groups.google.com/d/optout.

Samrat Batth

unread,
Aug 11, 2018, 6:06:08 AM8/11/18
to lmax-di...@googlegroups.com
From 3 different ring buffers.
So 1st and 2nd handlers will be write/update to 2 separate data structures and the 3rd one will only read the data structures.

The 3rd one is really fast (say market data) which will compare some values written by 1st and 2nd handler. The 1st and 2nd handlers don’t update the data structure that often (say once every few seconds).


Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "Disruptor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lmax-disruptor/ZDgI7eEGajY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lmax-disrupto...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages