Abstract base class for suspendable throttlers which throttle based on a count of pending items of some kind.
Abstract base class which tests an ISuspendableThrottlerCount instance. The abstract inc() and dec() methods (which increment and decrement the count) must be implemented.
Simple suspendable throttler which just counts the number of pending items, and throttles the suspendables based on that count. No data other than the pending count is stored.
Helper classes to manage the situations where a set of objects implementing ISuspendable should be throttled based on a count of pending items of some kind. For example, one common situation of this type is as follows:
1. You are streaming data from one or more ISuspendable sources. 2. For each chunk of data received you wish to do some processing which will not finish immediately. (Thus the received data need to be kept around in some way, forming a set of 'pending items'.) 3. The ISuspendables which are providing the input data must be throttled (i.e. suspended and resumed) based on the number of pending items.