ThrottledTaskPool

Special modified version of task pool to enhance outer context of task with reference to throttler.

Constructors

this
this()

Constructor

this
this(ISuspendableThrottler throttler)

Constructor

this
this(size_t suspend_point, size_t resume_point)

Constructor

Members

Functions

registerThrottlingHook
void registerThrottlingHook()

Registers throttling hook if not already present

restore
bool restore(void[] serialized)

Starts a task in the same manner as start but instead calls a restore method on the derived task with a serialized buffer of the state. This is to support dumping and loading tasks from disk.

start
bool start(ParametersOf!(TaskT.copyArguments) args)

Rewrite of TaskPool.start changed to use ProcessingTask as actual task type instead of plain OwnedTask. Right now it is done by dumb copy-paste, if that pattern will appear more often, TaskPool base class may need a slight refactoring to support it.

useThrottler
void useThrottler(ISuspendableThrottler throttler)

Sets or replaces current throttler instance

Variables

throttler
ISuspendableThrottler throttler;

Throttler used to control tempo of data consumption from streams. By default internally defined PoolThrottler is used which is bound by task pool size limit.

Meta