ProcessingTask

Example of processing task, one which is managed by StreamProcessor and gets scheduled for each new record arriving from Generator

Members

Functions

copyArguments
void copyArguments(int x)
Undocumented in source. Be warned that the author may not have intended to support it.
recycle
void recycle()
Undocumented in source. Be warned that the author may not have intended to support it.
run
void run()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

recycle_count
size_t recycle_count;
Undocumented in source.
total
int total;
Undocumented in source.

Variables

x
int x;
Undocumented in source.

Inherited Members

From Task

object_pool_index
size_t object_pool_index;

Reserved index field which ensures that any Task derivative can be used with ObjectPool. That comes at minor cost of one unused size_t per Task instance if not needed which is not a problem.

fiber
WorkerFiber fiber;

Fiber this task executes in

getThis
Task getThis()
assignTo
void assignTo(WorkerFiber fiber, void delegate() entry_point)

Assigns the task to a fiber. In most cases you need to use Scheduler.schedule instead.

suspend
void suspend()

Suspends execution of this task.

resume
void resume()

Resumes execution of this task. If task has not been started yet, starts it.

terminationHook
void terminationHook(void delegate() hook)

Registers a termination hook that will be executed when the Task is killed.

removeTerminationHook
void removeTerminationHook(void delegate() hook)

Unregisters a termination hook that would be executed when the Task is killed.

suspended
bool suspended()
finished
bool finished()
kill
void kill(istring file, int line)

Forces abnormal termination for the task by throwing special exception instance.

recycle
void recycle()

Method that will be run by scheduler when task finishes. Must be overridden by specific task class to reset reusable resources.

run
void run()

Method that must be overridden in actual application/library task classes to provide entry point.

entryPoint
bool entryPoint()

Internal wrapper around this.run() which is used as primary fiber entry point and ensures any uncaught exception propagates to the context that has started this task.

Meta