BLPAPI C++  3.21.0
EventDispatcher Class Reference

#include <blpapi_eventdispatcher.h>

Public Member Functions

 EventDispatcher (size_t numDispatcherThreads=1)
 
 ~EventDispatcher ()
 
int start ()
 
int stop (bool async=false)
 
blpapi_EventDispatcher_timpl () const
 

Detailed Description

Dispatches events from one or more Sessions through callbacks

EventDispatcher objects are optionally specified when Session objects are constructed. A single EventDispatcher can be shared by multiple Session objects.

The EventDispatcher provides an event-driven interface, generating callbacks from one or more internal threads for one or more sessions.

See Component blpapi_eventdispatcher

Constructor & Destructor Documentation

◆ EventDispatcher()

EventDispatcher ( size_t  numDispatcherThreads = 1)

Construct an EventDispatcher with the specified numDispatcherThreads. If numDispatcherThreads is 1 (the default) then a single internal thread is created to dispatch events. If numDispatcherThreads is greater than 1 then an internal pool of numDispatcherThreads threads is created to dispatch events. The behavior is undefined if numDispatcherThreads is 0.

◆ ~EventDispatcher()

Destructor.

Member Function Documentation

◆ impl()

blpapi_EventDispatcher_t * impl ( ) const

Returns the internal implementation.

◆ start()

int start ( )

Start generating callbacks for events from sessions associated with this EventDispatcher. Return 0 on success and a non zero value otherwise.

◆ stop()

int stop ( bool  async = false)

Shutdown this event dispatcher object and stop generating callbacks for events from sessions associated with it. If the specified async is false (the default) then this method blocks until all current callbacks which were dispatched through this EventDispatcher have completed. Return 0 on success and a non zero value otherwise.

Note: Calling stop with async of false from within a callback dispatched by this EventDispatcher is undefined and may result in a deadlock.


The documentation for this class was generated from the following file: