Constructor
Check if the total number of active tasks is below the desired limit to resume.
Check if the total number of active tasks has reached the desired limit to suspend.
Reference to the throttled pool
When amount of total queued tasks is <= this value, the input will be resumed.
When amount of total queued tasks is >= this value, the input will be suspended.
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.
Removes a suspendable from the list of suspendables if it exists.
Clears the list of suspendables.
Checks if the suspend limit has been reached and the suspendables need to be suspended.
Checks if resume limit has been reached and the suspendables need to be resumed.
Decides whether the suspendables should be suspended. Called by throttledSuspend() when not suspended.
Decides whether the suspendables should be resumed. Called by throttledResume() when suspended.
Default throttler implementation used if no external one is supplied via constructor. It throttles on amount of busy tasks in internal task pool.