blpapi.EventQueue

class blpapi.EventQueue

A construct used to handle replies to request synchronously.

When a request is submitted an application can either handle the responses asynchronously as they arrive or use an EventQueue to handle all responses for a given request or requests synchronously. The EventQueue will only deliver responses to the request(s) it is associated with.

__init__()

Construct an empty EventQueue which can be passed to sendRequest() and sendAuthorizationRequest() methods.

destroy()

Destroy the handle using stored dtor

Return type:

None

isValid()

Returns: True if this class holds a handle and the handle is not None.

Return type:

bool

nextEvent(timeout=0)
Parameters:

timeout (int) – Timeout threshold in milliseconds.

Return type:

Event

Returns:

The next Event available from the EventQueue.

If the specified timeout is zero this method will wait forever for the next event. If the specified timeout is non zero then if no Event is available within the specified timeout an Event with type of TIMEOUT will be returned.

purge()

Purge any Event objects in this EventQueue.

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.

Return type:

None

tryNextEvent()
Return type:

Optional[Event]

Returns:

If the EventQueue is non-empty, the next Event available, otherwise None.