|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bloomberglp.blpapi.EventQueue
public class EventQueue
The EventQueue class allows an application to block and receive Events for requests in a synchronous manner.
An Request can be associated with an EventQueue by passing a valid instance
of the EventQueue class to the
sendRequest
and
sendAuthorizationRequest
methods. All responses to the Request are now
delivered to this EventQueue allowing the application to block for Responses
for the Request. Note that a single EventQueue can be used for receiving
Response Events for many requests.
Constructor Summary | |
---|---|
EventQueue()
Construct an empty event queue. |
Method Summary | |
---|---|
Event |
nextEvent()
Retrieves the next event available for processing on this EventQueue |
Event |
nextEvent(long timeoutMillis)
Retrieves the next event available for processing on this EventQueue |
void |
purge()
Purge all events from this Event Queue and cancel all Requests that this Event Queue is associated with |
Event |
tryNextEvent()
Tries to retrieve the next event available for processing on this EventQueue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventQueue()
Method Detail |
---|
public Event nextEvent() throws java.lang.InterruptedException
This method is the same as calling nextEvent(0)
java.lang.InterruptedException
- if another thread has interrupted the current threadpublic Event nextEvent(long timeoutMillis) throws java.lang.InterruptedException
retrieve the next event available for processing on this EventQueue. If
no event is available immediately wait for timeoutMillis
milliseconds for an event to arrive. If no event is received before the
timeout expires return a Event.EventType.TIMEOUT
event. If the
timeout specified is 0 then wait for an infinite amount of time for an
event to be received.
timeoutMillis
- timeout in milliseconds to wait for an event to be available
Event.EventType.TIMEOUT
event if timeout occurs
java.lang.InterruptedException
- if another thread has interrupted the current threadpublic Event tryNextEvent()
This method never blocks.
public void purge()
Purges any Event objects in this EventQueue which have not been processed and cancel any pending requests linked to this EventQueue. The EventQueue can subsequently be re-used for a subsequent request.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |