ISuspendableThrottler

Abstract base class for suspendable throttlers.

Provides the following functionality: * Maintains a set of ISuspendables which are suspended / resumed together. * A throttle() method, to be called when the suspension state should be updated / reassessed. * Abstract suspend() and resume() methods which define the conditions for suspension and resumption of the set of ISuspendables. * A suspended() method to tell whether the ISuspendables are suspended.

Members

Functions

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.

clear
void clear()

Clears the list of suspendables.

removeSuspendable
void removeSuspendable(ISuspendable s)

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

resume
bool resume()

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

suspend
bool suspend()

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

suspended
bool suspended()
throttledResume
void throttledResume()

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

throttledSuspend
void throttledSuspend()

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

Meta