#include <blpapi_event.h>
Public Member Functions | |
EventQueue () | |
~EventQueue () | |
Event | nextEvent (int timeout=0) |
int | tryNextEvent (Event *event) |
void | purge () |
blpapi_EventQueue_t * | handle () const |
A construct used to handle replies to request synchronously.
An EventQueue can be supplied when using Session::sendRequest() and Session::sendAuthorizationRequest() methods.
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.
blpapi::EventQueue::EventQueue | ( | ) |
Construct an empty event queue.
blpapi::EventQueue::~EventQueue | ( | ) |
Destroy this event queue and cancel any pending request that are linked to this queue.
Event blpapi::EventQueue::nextEvent | ( | int | timeout = 0 |
) |
Returns the next Event available from the EventQueue. If the specified timeout
is zero this 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 a type() of TIMEOUT will be returned.
int blpapi::EventQueue::tryNextEvent | ( | Event * | event | ) |
If the EventQueue is non-empty, load the next Event available into event and return 0 indicating success. If the EventQueue is empty, return a non-zero value with no effect on event or the the state of EventQueue. This method never blocks.
void blpapi::EventQueue::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.
blpapi_EventQueue_t* blpapi::EventQueue::handle | ( | ) | const |