SpecializedPoolThrottler

Throttler implementation intended to be used with a specialized task pools.

Constructors

this
this(IPoolInfo pool, size_t suspend_point, size_t resume_point, istring name)

Constructor

Members

Functions

resume
bool resume()

Check if the total number of active tasks is below the desired limit to resume.

suspend
bool suspend()

Check if the total number of active tasks has reached the desired limit to suspend.

Variables

pool
IPoolInfo pool;

Reference to the throttled pool

resume_point
size_t resume_point;

When amount of total queued tasks is <= this value, the input will be resumed.

suspend_point
size_t suspend_point;

When amount of total queued tasks is >= this value, the input will be suspended.

task_class_name
istring task_class_name;

String representation of the class name of the task handled by the host task pool.

Inherited Members

From ISuspendableThrottler

addSuspendable
void addSuspendable(ISuspendable s)

Adds a suspendable to the list of suspendables which are to be throttled if it's not already in there. Also ensures that the state of the added suspendable is consistent with the state of the throttler.

removeSuspendable
void removeSuspendable(ISuspendable s)

Removes a suspendable from the list of suspendables if it exists.

suspended
bool suspended()
clear
void clear()

Clears the list of suspendables.

throttledSuspend
void throttledSuspend()

Checks if the suspend limit has been reached and the suspendables need to be suspended.

throttledResume
void throttledResume()

Checks if resume limit has been reached and the suspendables need to be resumed.

suspend
bool suspend()

Decides whether the suspendables should be suspended. Called by throttledSuspend() when not suspended.

resume
bool resume()

Decides whether the suspendables should be resumed. Called by throttledResume() when suspended.

Meta