Class ReactorDispatcher
- java.lang.Object
-
- com.microsoft.azure.eventhubs.impl.ReactorDispatcher
-
public final class ReactorDispatcher extends Object
Reactor
is not thread-safe - all calls toProton
API's should be - on the Reactor Thread.Reactor
works out-of-box for all event driven API - ex: onReceive - which could raise upon onSocketRead.Reactor
didn't support API's like Send() out-of-box - which could potentially run on different thread to that of Reactor. So, the following utility class is used to generate an Event to hook intoReactor
's event delegation pattern. It uses aPipe
as the IO on which Reactor Listens to. Cardinality: multipleReactorDispatcher
's could be attached to 1Reactor
. EachReactorDispatcher
should be initialized Synchronously - as it calls API inReactor
which is not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description ReactorDispatcher(org.apache.qpid.proton.reactor.Reactor reactor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
invoke(int delay, DispatchHandler timerCallback)
void
invoke(DispatchHandler timerCallback)
-
-
-
Constructor Detail
-
ReactorDispatcher
public ReactorDispatcher(org.apache.qpid.proton.reactor.Reactor reactor) throws IOException
- Throws:
IOException
-
-
Method Detail
-
invoke
public void invoke(DispatchHandler timerCallback) throws IOException, RejectedExecutionException
-
invoke
public void invoke(int delay, DispatchHandler timerCallback) throws IOException, RejectedExecutionException
-
-