dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
SimpleHandler< Signature > Struct Template Reference

A thread-safe list of listeners with a given signature. More...

Detailed Description

template<typename Signature>
struct SimpleHandler< Signature >

A thread-safe list of listeners with a given signature.

Listeners can be any callable entities.

handle() calls the listeners on the current thread (the thread that notifies): the "main" listeners, then the "low priority" ones, in the order of addition. It takes a snapshot of the list under a lock and calls the listeners outside of it, so a listener can add or remove listeners and call handle() of the same handler. A listener added during a notification is called from the next one. If the source notifies on several threads at once, the listeners are called on these threads at once.

An exception of a listener is reported to ErrorManager; the other listeners are still called.

Template Parameters
SignatureThe arguments "signature" (example: void(int, int))