#include <Serializer.h>
Inheritance diagram for qpid::sys::Serializer< Task >:
Public Member Functions | |
Serializer (bool immediate=true) | |
Start a serializer. | |
void | execute (Task &task) |
Task may be executed immediately in the calling thread if there are no other tasks pending or executing and the "immediate" paramater to the constructor was true. | |
void | dispatch () |
Execute pending tasks sequentially in calling thread. |
Task is a void returning 0-arg functor. It must not throw exceptions.
Note we deliberately do not use boost::function as the task type because copying a boost::functor allocates the target object on the heap.
qpid::sys::Serializer< Task >::Serializer | ( | bool | immediate = true |
) | [inline] |
Start a serializer.
immediate | Allow execute() to execute a task immediatly in the current thread. |
void qpid::sys::Serializer< Task >::dispatch | ( | ) | [virtual] |
Execute pending tasks sequentially in calling thread.
Drains the task queue and returns, does not block for more tasks.
ShutdownException | if the serializer is being destroyed. |
Implements qpid::sys::SerializerBase.
void qpid::sys::Serializer< Task >::execute | ( | Task & | task | ) |
Task may be executed immediately in the calling thread if there are no other tasks pending or executing and the "immediate" paramater to the constructor was true.
Otherwise task will be enqueued for execution by a dispatch thread.