TibrvQueue.dispatch()
Method
Declaration
voiddispatch
()
throws TibrvException, java.lang.InterruptedException
Purpose
Dispatch an event; if no event is ready, block.
Remarks
If the queue is not empty, then this call dispatches the event at the head of the queue, and then returns. If the queue is empty, then this call blocks indefinitely while waiting for the queue to receive an event.
Interrupting a Dispatch Call
To interrupt an event dispatch thread in the Java implementation (see Tibrv.open()), use the Java method Thread.interrupt()
.
In the JNI (native) implementation, this call does not throw InterruptedException; instead, programs must explicitly check for interruptions by calling Thread.interrupted()
before or after TibrvQueue.dispatch().
The more reliable way to interrupt a JNI event dispatch thread is to destroy the TibrvDispatchable object that the thread dispatches. When the dispatch call encounters the invalid queue or queue group, it throws a TibrvException in the event dispatch thread.