DescriptionIssue #4692 - Move responsibility for engine reference from tasks to scheduler
Move scheduler items from "JsEngine.h", where they are in the public API, to
"JsEngineInternal.h", where they are not. As part of this, changed the
scheduler member from a PImpl/allocated member of `JsEngine` to as an ordinary
member in `JsEngineInternal`.
Added abstract base class `TaskFunctionInterface`. This removes the need for
the adapter class `HeapFunction`. In addition, this anticipates needing to do
more with tasks than simply run them.
Added `Task`, an initial version of a proper task class for the scheduler. It
contains shared pointers for both the task body and the engine. It has
responsibility for allocation of tasks on the heap. The shared pointer to the
engine keeps the engine in existence for the duration of the task, taking that
responsibility from the task. This removes the last necessity for a task to
hold such a shared pointer and thus finally removes any need for engine
self-reference.
Changed the web request task and the five I/O tasks to use these mechanisms.
They all now derive from `TaskFunctionInterface`. The `JsEnginePtr` member in
each task was replaced with a plain pointer to `JsEngineInternal`. This
removes the last engine self-reference for these tasks.
Patch Set 1 : #
MessagesTotal messages: 1
|