Threading¶
Support classes for threading tasks like synchronized queues, a task abstraction, or a thread pools for dispatching asynchronous events with ordering guarantees.
Data Structures¶
SynchronizedQueue
provides a reentrant queue
Task Pattern¶
An abstraction for executing tasks as self-contained pieces of work that are executed in different threads. The base class Task
provides a simple interface somewhat inspired from the Java Runnable
or Callable
interfaces. Tasks are submitted to an implementation of TaskExecutor
which is responsible of launching the task at some time. The lifecycle control of the task is done in the instance itself.
Besides the basic task, RepetitiveTask
and PeriodicTask
provide a base for tasks that execute a loop over and over again.
Dispatching¶
OrderedQueueDispatcherPool
provides a threaded event dispatching strategy to interested clients with the guarantee that the event stream of each client is ordered. No guarantees are given between different clients.