Session Constructor (SessionOptions, EventHandler, EventDispatcher) |
If the specified eventHandler is not null then this Session will operate in asynchronous mode, otherwise the Session will operate in Synchronous mode.
If eventDispatcher is null then the Session will create a default EventDispatcher for this Session which will use a single thread for dispatching events. For more control over event dispatching a specific instance of EventDispatcher can be supplied. This can be used to share a single EventDispatcher among multiple Session objects.
If an eventDispatcher is supplied which uses more than one thread the Session will ensure that events which should be ordered are passed to callbacks in a correct order. For example, updates to a single subscription.
Each EventDispatcher uses its own thread or pool of threads so if you want to ensure that a session which receives very large messages and takes a long time to process them does not delay a session that receives small messages and processes each one very quickly then give each one a separate EventDispatcher.
Namespace: Bloomberglp.Blpapi
public Session( SessionOptions sessionOptions, EventHandler handler, EventDispatcher dispatcher )