QuantumLibrary
Bloomberg::quantum::Dispatcher Class Reference

Parallel execution engine used to run coroutines or IO tasks asynchronously. This class is the main entry point into the library. More...

#include <quantum_dispatcher.h>

Inheritance diagram for Bloomberg::quantum::Dispatcher:
Bloomberg::quantum::ITerminate

Public Types

using ContextTag = ThreadContextTag
 

Public Member Functions

DEPRECATED Dispatcher (int numCoroutineThreads=-1, int numIoThreads=5, bool pinCoroutineThreadsToCores=false)
 Constructor. More...
 
 Dispatcher (const Configuration &config)
 Constructor. @oaram[in] config The configuration for the Quantum dispatcher. More...
 
 ~Dispatcher ()
 Destructor. More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadContextPtr< RET > post (FUNC &&func, ARGS &&... args)
 Post a coroutine to run asynchronously. More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadContextPtr< RET > post (int queueId, bool isHighPriority, FUNC &&func, ARGS &&... args)
 Post a coroutine to run asynchronously on a specific queue (thread). More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadContextPtr< RET > postFirst (FUNC &&func, ARGS &&... args)
 Post the first coroutine in a continuation chain to run asynchronously. More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadContextPtr< RET > postFirst (int queueId, bool isHighPriority, FUNC &&func, ARGS &&... args)
 Post the first coroutine in a continuation chain to run asynchronously on a specific queue (thread). More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadFuturePtr< RET > postAsyncIo (FUNC &&func, ARGS &&... args)
 Post a blocking IO (or long running) task to run asynchronously on the IO thread pool. More...
 
template<class RET = int, class FUNC , class ... ARGS>
ThreadFuturePtr< RET > postAsyncIo (int queueId, bool isHighPriority, FUNC &&func, ARGS &&... args)
 Post a blocking IO (or long running) task to run asynchronously on a specific thread in the IO thread pool. More...
 
template<class RET = int, class INPUT_IT , class = Traits::IsInputIterator<INPUT_IT>>
ThreadContextPtr< std::vector< RET > > forEach (INPUT_IT first, INPUT_IT last, Functions::ForEachFunc< RET, INPUT_IT > func)
 Applies the given unary function to all the elements in the range [first,last). This function runs in parallel. More...
 
template<class RET = int, class INPUT_IT >
ThreadContextPtr< std::vector< RET > > forEach (INPUT_IT first, size_t num, Functions::ForEachFunc< RET, INPUT_IT > func)
 Same as forEach() but takes a length as second argument in case INPUT_IT is not a random access iterator. More...
 
template<class RET = int, class INPUT_IT , class = Traits::IsInputIterator<INPUT_IT>>
ThreadContextPtr< std::vector< std::vector< RET > > > forEachBatch (INPUT_IT first, INPUT_IT last, Functions::ForEachFunc< RET, INPUT_IT > func)
 The batched version of forEach(). This function applies the given unary function to all the elements in the range [first,last). This function runs serially with respect to other functions in the same batch. More...
 
template<class RET = int, class INPUT_IT >
ThreadContextPtr< std::vector< std::vector< RET > > > forEachBatch (INPUT_IT first, size_t num, Functions::ForEachFunc< RET, INPUT_IT > func)
 Same as forEachBatch() but takes a length as second argument in case INPUT_IT is not a random access iterator. More...
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT , class = Traits::IsInputIterator<INPUT_IT>>
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > mapReduce (INPUT_IT first, INPUT_IT last, Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > mapper, Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > reducer)
 Implementation of map-reduce functionality. More...
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > mapReduce (INPUT_IT first, size_t num, Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > mapper, Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > reducer)
 Same as mapReduce() but takes a length as second argument in case INPUT_IT is not a random access iterator. More...
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT , class = Traits::IsInputIterator<INPUT_IT>>
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > mapReduceBatch (INPUT_IT first, INPUT_IT last, Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > mapper, Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > reducer)
 This version of mapReduce() runs both the mapper and the reducer functions in batches for improved performance. This should be used in the case where the functions are more CPU intensive with little or no IO. More...
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > mapReduceBatch (INPUT_IT first, size_t num, Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > mapper, Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > reducer)
 Same as mapReduceBatch() but takes a length as second argument in case INPUT_IT is not a random access iterator. More...
 
void terminate () final
 Signal all threads to immediately terminate and exit. All other pending coroutines and IO tasks will not complete. Call this function for a fast shutdown of the dispatcher. More...
 
size_t size (IQueue::QueueType type=IQueue::QueueType::All, int queueId=(int) IQueue::QueueId::All) const
 Returns the total number of queued tasks for the specified type and queue id. More...
 
bool empty (IQueue::QueueType type=IQueue::QueueType::All, int queueId=(int) IQueue::QueueId::All) const
 Check if the specified type and queue id is empty (i.e. there are no running tasks) More...
 
void drain (std::chrono::milliseconds timeout=std::chrono::milliseconds::zero())
 Drains all queues on this dispatcher object. More...
 
int getNumCoroutineThreads () const
 Returns the number of underlying coroutine threads as specified in the constructor. If -1 was passed than this number essentially indicates the number of cores. More...
 
int getNumIoThreads () const
 Returns the number of underlying IO threads as specified in the constructor. More...
 
const std::pair< int, int > & getCoroQueueIdRangeForAny () const
 Gets the range [minQueueId, maxQueueId] of coroutine queueIds covered by IQueue::QueueId::Any when using Dispatcher::post. More...
 
QueueStatistics stats (IQueue::QueueType type=IQueue::QueueType::All, int queueId=(int) IQueue::QueueId::All)
 Returns a statistics object for the specified type and queue id. More...
 
void resetStats ()
 Resets all coroutine and IO queue counters. More...
 
- Public Member Functions inherited from Bloomberg::quantum::ITerminate
virtual ~ITerminate ()=default
 Virtual destructor. This function is explicitly left empty. More...
 

Detailed Description

Parallel execution engine used to run coroutines or IO tasks asynchronously. This class is the main entry point into the library.

Member Typedef Documentation

◆ ContextTag

Constructor & Destructor Documentation

◆ Dispatcher() [1/2]

Bloomberg::quantum::Dispatcher::Dispatcher ( int  numCoroutineThreads = -1,
int  numIoThreads = 5,
bool  pinCoroutineThreadsToCores = false 
)
inline

Constructor.

This will build two thread pools, one used for running parallel coroutines and another used for running blocking IO tasks.

Parameters
[in]numCoroutineThreadsNumber of parallel threads running coroutines. -1 indicates one per core.
[in]numIoThreadsNumber of parallel threads running blocking IO calls.
[in]pinCoroutineThreadsToCoresIf set to true, it will pin all coroutine threads unto physical cores. provided numCoroutineThreads <= cores.
Warning
This constructor is deprecated and will be removed in v1.0. Use the configuration-based constructor instead.

◆ Dispatcher() [2/2]

Bloomberg::quantum::Dispatcher::Dispatcher ( const Configuration config)
explicit

Constructor. @oaram[in] config The configuration for the Quantum dispatcher.

◆ ~Dispatcher()

Bloomberg::quantum::Dispatcher::~Dispatcher ( )

Destructor.

Destroys the task dispatcher object. This will wait until all coroutines complete, signal all worker threads (coroutine and IO) to exit and join them.

Member Function Documentation

◆ drain()

void Bloomberg::quantum::Dispatcher::drain ( std::chrono::milliseconds  timeout = std::chrono::milliseconds::zero())
inline

Drains all queues on this dispatcher object.

Parameters
[in]timeoutMaximum time for this function to wait. Set to 0 to wait indefinitely until all queues drain.
Note
This function blocks until all coroutines and IO tasks have completed. During this time, posting of new tasks is disabled unless they are posted from within an already executing coroutine.

◆ empty()

bool Bloomberg::quantum::Dispatcher::empty ( IQueue::QueueType  type = IQueue::QueueType::All,
int  queueId = (int)IQueue::QueueId::All 
) const
inline

Check if the specified type and queue id is empty (i.e. there are no running tasks)

Parameters
[in]typeThe type of queue.
[in]queueIdThe queue number to query. Valid range is [0, numCoroutineThreads) for IQueue::QueueType::Coro, [0, numIoThreads) for IQueue::QueueType::IO and IQueue::QueueId::All for either.
Returns
True if empty, false otherwise.
Note
IQueue::QueueId::Same is an invalid queue id. IQueue::QueueId::Any is only valid for IO queue type. When type IQueue::QueueType::All is specified, the queueId is not used and must be left at default value.

◆ forEach() [1/2]

template<class RET , class INPUT_IT , class >
ThreadContextPtr< std::vector< RET > > Bloomberg::quantum::Dispatcher::forEach ( INPUT_IT  first,
INPUT_IT  last,
Functions::ForEachFunc< RET, INPUT_IT >  func 
)

Applies the given unary function to all the elements in the range [first,last). This function runs in parallel.

Template Parameters
RETThe return value of the unary function.
UNARY_FUNCA unary function of type 'RET(*INPUT_IT)'.
InputItThe type of iterator. @oaram[in] first The first element in the range. @oaram[in] last The last element in the range (exclusive). @oaram[in] func The unary function.
Returns
A vector of future values corresponding to the output of 'func' on every element in the range.
Note
Use this function if InputIt meets the requirement of a RandomAccessIterator
Each func invocation will run inside its own coroutine instance.

◆ forEach() [2/2]

template<class RET , class INPUT_IT >
ThreadContextPtr< std::vector< RET > > Bloomberg::quantum::Dispatcher::forEach ( INPUT_IT  first,
size_t  num,
Functions::ForEachFunc< RET, INPUT_IT >  func 
)

Same as forEach() but takes a length as second argument in case INPUT_IT is not a random access iterator.

◆ forEachBatch() [1/2]

template<class RET , class INPUT_IT , class >
ThreadContextPtr< std::vector< std::vector< RET > > > Bloomberg::quantum::Dispatcher::forEachBatch ( INPUT_IT  first,
INPUT_IT  last,
Functions::ForEachFunc< RET, INPUT_IT >  func 
)

The batched version of forEach(). This function applies the given unary function to all the elements in the range [first,last). This function runs serially with respect to other functions in the same batch.

Returns
A vector of value vectors (i.e. one per batch).
Note
Use this function if InputIt meets the requirement of a RandomAccessIterator.
The input range is split equally among coroutines and executed in batches. This function achieves higher throughput rates than the non-batched mode, if func() is CPU-bound.

◆ forEachBatch() [2/2]

template<class RET , class INPUT_IT >
ThreadContextPtr< std::vector< std::vector< RET > > > Bloomberg::quantum::Dispatcher::forEachBatch ( INPUT_IT  first,
size_t  num,
Functions::ForEachFunc< RET, INPUT_IT >  func 
)

Same as forEachBatch() but takes a length as second argument in case INPUT_IT is not a random access iterator.

◆ getCoroQueueIdRangeForAny()

const std::pair< int, int > & Bloomberg::quantum::Dispatcher::getCoroQueueIdRangeForAny ( ) const
inline

Gets the range [minQueueId, maxQueueId] of coroutine queueIds covered by IQueue::QueueId::Any when using Dispatcher::post.

Returns
queueIdRange The range of queueIds that IQueue::QueueId::Any covers

◆ getNumCoroutineThreads()

int Bloomberg::quantum::Dispatcher::getNumCoroutineThreads ( ) const
inline

Returns the number of underlying coroutine threads as specified in the constructor. If -1 was passed than this number essentially indicates the number of cores.

Returns
The number of threads.
Note
Each thread services its own queueId, therefore this number can be used when assigning coroutines to a specific queue.

◆ getNumIoThreads()

int Bloomberg::quantum::Dispatcher::getNumIoThreads ( ) const
inline

Returns the number of underlying IO threads as specified in the constructor.

Returns
The number of threads.
Note
Each thread services its own queueId, therefore this number can be used when assigning IO tasks to a specific queue.

◆ mapReduce() [1/2]

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT , class >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > Bloomberg::quantum::Dispatcher::mapReduce ( INPUT_IT  first,
INPUT_IT  last,
Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT >  mapper,
Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE >  reducer 
)

Implementation of map-reduce functionality.

Template Parameters
KEYThe KEY type used for mapping and reducing.
MAPPED_TYPEThe output type after a map operation.
REDUCED_TYPEThe output type after a reduce operation.
MAPPER_FUNCThe mapper function having the signature 'std::vector<std::pair<KEY,MAPPED_TYPE>>(*INPUT_IT)'
REDUCER_FUNCThe reducer function having the signature 'std::pair<KEY,REDUCED_TYPE>(std::pair<KEY, std::vector<MAPPED_TYPE>>&&)'
INPUT_ITThe iterator type. @oaram[in] first The start iterator to a list of items to be processed in the range [first,last). @oaram[in] last The end iterator to a list of items (not inclusive). @oaram[in] mapper The mapper function. @oaram[in] reducer The reducer function.
Returns
A future to a reduced map of values.
Note
Use this function if InputIt meets the requirement of a RandomAccessIterator.

◆ mapReduce() [2/2]

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > Bloomberg::quantum::Dispatcher::mapReduce ( INPUT_IT  first,
size_t  num,
Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT >  mapper,
Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE >  reducer 
)

Same as mapReduce() but takes a length as second argument in case INPUT_IT is not a random access iterator.

◆ mapReduceBatch() [1/2]

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT , class >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > Bloomberg::quantum::Dispatcher::mapReduceBatch ( INPUT_IT  first,
INPUT_IT  last,
Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT >  mapper,
Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE >  reducer 
)

This version of mapReduce() runs both the mapper and the reducer functions in batches for improved performance. This should be used in the case where the functions are more CPU intensive with little or no IO.

Note
Use this function if InputIt meets the requirement of a RandomAccessIterator.

◆ mapReduceBatch() [2/2]

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
ThreadContextPtr< std::map< KEY, REDUCED_TYPE > > Bloomberg::quantum::Dispatcher::mapReduceBatch ( INPUT_IT  first,
size_t  num,
Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT >  mapper,
Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE >  reducer 
)

Same as mapReduceBatch() but takes a length as second argument in case INPUT_IT is not a random access iterator.

◆ post() [1/2]

template<class RET , class FUNC , class ... ARGS>
ThreadContextPtr< RET > Bloomberg::quantum::Dispatcher::post ( FUNC &&  func,
ARGS &&...  args 
)

Post a coroutine to run asynchronously.

This method will post the coroutine on any thread available. Typically it will pick one which has the smallest number of concurrent coroutines executing at the time of the post.

Template Parameters
RETType of future returned by this coroutine.
FUNCCallable object type which will be wrapped in a coroutine. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(CoroContext<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread context object.
Note
This function is non-blocking and returns immediately. The returned thread context cannot be used to chain further coroutines.

◆ post() [2/2]

template<class RET , class FUNC , class ... ARGS>
ThreadContextPtr< RET > Bloomberg::quantum::Dispatcher::post ( int  queueId,
bool  isHighPriority,
FUNC &&  func,
ARGS &&...  args 
)

Post a coroutine to run asynchronously on a specific queue (thread).

Template Parameters
RETType of future returned by this coroutine.
FUNCCallable object type which will be wrapped in a coroutine. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(CoroContext<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]queueIdId of the queue where this coroutine should run. Note that the user can specify IQueue::QueueId::Any as a value, which is equivalent to running the simpler version of post() above. Valid range is [0, numCoroutineThreads) or IQueue::QueueId::Any.
[in]isHighPriorityIf set to true, the coroutine will be scheduled to run immediately after the currently executing coroutine on 'queueId' has completed or has yielded.
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread context object.
Note
This function is non-blocking and returns immediately. The returned thread context cannot be used to chain further coroutines.

◆ postAsyncIo() [1/2]

template<class RET , class FUNC , class ... ARGS>
ThreadFuturePtr< RET > Bloomberg::quantum::Dispatcher::postAsyncIo ( FUNC &&  func,
ARGS &&...  args 
)

Post a blocking IO (or long running) task to run asynchronously on the IO thread pool.

Template Parameters
RETType of future returned by this task.
FUNCCallable object type. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(ThreadPromise<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread future object.
Note
This function is non-blocking and returns immediately. The passed function will not be wrapped in a coroutine.

◆ postAsyncIo() [2/2]

template<class RET , class FUNC , class ... ARGS>
ThreadFuturePtr< RET > Bloomberg::quantum::Dispatcher::postAsyncIo ( int  queueId,
bool  isHighPriority,
FUNC &&  func,
ARGS &&...  args 
)

Post a blocking IO (or long running) task to run asynchronously on a specific thread in the IO thread pool.

Template Parameters
RETType of future returned by this task.
FUNCCallable object type. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(ThreadPromise<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]queueIdId of the queue where this task should run. Note that the user can specify IQueue::QueueId::Any as a value, which is equivalent to running the simpler version of postAsyncIo() above. Valid range is [0, numCoroutineThreads) or IQueue::QueueId::Any.
[in]isHighPriorityIf set to true, the task will be scheduled to run immediately.
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread future object.
Note
This function is non-blocking and returns immediately. The passed function will not be wrapped in a coroutine.

◆ postFirst() [1/2]

template<class RET , class FUNC , class ... ARGS>
ThreadContextPtr< RET > Bloomberg::quantum::Dispatcher::postFirst ( FUNC &&  func,
ARGS &&...  args 
)

Post the first coroutine in a continuation chain to run asynchronously.

Template Parameters
RETType of future returned by this coroutine.
FUNCCallable object type which will be wrapped in a coroutine. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(CoroContext<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread context object.
Note
This function is non-blocking and returns immediately. The returned context can be used to chain other coroutines which will run sequentially.

◆ postFirst() [2/2]

template<class RET , class FUNC , class ... ARGS>
ThreadContextPtr< RET > Bloomberg::quantum::Dispatcher::postFirst ( int  queueId,
bool  isHighPriority,
FUNC &&  func,
ARGS &&...  args 
)

Post the first coroutine in a continuation chain to run asynchronously on a specific queue (thread).

Template Parameters
RETType of future returned by this coroutine.
FUNCCallable object type which will be wrapped in a coroutine. Can be a standalone function, a method, an std::function, a functor generated via std::bind or a lambda. The signature of the callable object must strictly be 'int f(CoroContext<RET>::Ptr, ...)'.
ARGSArgument types passed to FUNC.
Parameters
[in]queueIdId of the queue where this coroutine should run. Note that the user can specify IQueue::QueueId::Any as a value, which is equivalent to running the simpler version of post() above. Valid range is [0, numCoroutineThreads) or IQueue::QueueId::Any.
[in]isHighPriorityIf set to true, the coroutine will be scheduled to run immediately after the currently executing coroutine on 'queueId' has completed or has yielded.
[in]funcCallable object.
[in]argsVariable list of arguments passed to the callable object.
Returns
A pointer to a thread context object.
Note
This function is non-blocking and returns immediately. The returned context can be used to chain other coroutines which will run sequentially.

◆ resetStats()

void Bloomberg::quantum::Dispatcher::resetStats ( )
inline

Resets all coroutine and IO queue counters.

◆ size()

size_t Bloomberg::quantum::Dispatcher::size ( IQueue::QueueType  type = IQueue::QueueType::All,
int  queueId = (int)IQueue::QueueId::All 
) const
inline

Returns the total number of queued tasks for the specified type and queue id.

Parameters
[in]typeThe type of queue.
[in]queueIdThe queue number to query. Valid range is [0, numCoroutineThreads) for IQueue::QueueType::Coro, [0, numIoThreads) for IQueue::QueueType::IO and IQueue::QueueId::All for either.
Returns
The total number of queued tasks including the currently executing one.
Note
IQueue::QueueId::Same is an invalid queue id. IQueue::QueueId::Any is only valid for IO queue type. When type IQueue::QueueType::All is specified, the queueId is not used and must be left at default value.

◆ stats()

QueueStatistics Bloomberg::quantum::Dispatcher::stats ( IQueue::QueueType  type = IQueue::QueueType::All,
int  queueId = (int)IQueue::QueueId::All 
)
inline

Returns a statistics object for the specified type and queue id.

Parameters
[in]typeThe type of queue.
[in]queueIdThe queue number to query. Valid range is [0, numCoroutineThreads) for IQueue::QueueType::Coro, [0, numIoThreads) for IQueue::QueueType::IO and IQueue::QueueId::All for either.
Returns
Aggregated or individual queue stats.
Note
IQueue::QueueId::Same is an invalid queue id. IQueue::QueueId::Any is only valid for IO queue type. When type IQueue::QueueType::All is specified, the queueId is not used and must be left at default value.

◆ terminate()

void Bloomberg::quantum::Dispatcher::terminate ( )
inlinefinalvirtual

Signal all threads to immediately terminate and exit. All other pending coroutines and IO tasks will not complete. Call this function for a fast shutdown of the dispatcher.

Note
This function blocks.

Implements Bloomberg::quantum::ITerminate.