[#SerialTaskRunner]
= SerialTaskRunner
:mrdocs:

Class used by CScheduler clients which may schedule multiple jobs which are required to be run serially&period; Jobs may not be run on the same thread, but no two jobs will be executed at the same time and memory will be release&hyphen;acquire consistent (the scheduler will internally do an acquire before invoking a callback as well as a release at the end)&period; In practice this means that a callback B() will be able to observe all of the effects of callback A() which executed before it&period;

== Synopsis

Declared in `&lt;scheduler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class SerialTaskRunner
    : public xref:util/TaskRunnerInterface.adoc[util::TaskRunnerInterface]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:util/TaskRunnerInterface.adoc[util::TaskRunnerInterface]`
| This header provides an interface and simple implementation for a task runner&period; Another threaded, serial implementation using a queue is available in the scheduler module&apos;s SerialTaskRunner&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:SerialTaskRunner/2constructor.adoc[`SerialTaskRunner`]         [.small]#[constructor]#
| Constructs a runner that serializes callbacks onto the given scheduler&period;
| xref:SerialTaskRunner/flush.adoc[`flush`]  [.small]#[virtual]#
| Processes all remaining queue members on the calling thread, blocking until queue is empty Must be called after the CScheduler has no remaining processing threads!
| xref:SerialTaskRunner/insert.adoc[`insert`]  [.small]#[virtual]#
| Add a callback to be executed&period; Callbacks are executed serially and memory is release&hyphen;acquire consistent between callback executions&period; Practically, this means that callbacks can behave as if they are executed in order by a single thread&period;
| xref:SerialTaskRunner/size.adoc[`size`]  [.small]#[virtual]#
| Returns the number of callbacks still pending in the runner&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
