BloombergLP::bdlmt::Throttle::nextPermit

Load into the specified result the earliest absolute time (according to system clock configured at initialization) when the specified numActions will next be permitted. Return 0 on success, and a non-zero value (with no effect on result) if this throttle is configured such that numActions will never be permitted (i.e., return an error if numActions > maxSimultaneousActions) or if numActions <= 0. The returned result is an offset from the epoch of the system clock for which this throttle is configured. The behavior is undefined unless this throttle has been initialized (either by calling initialize or using a BDLMT_THROTTLE_INIT* macro). Note that result may be in the past, and this function does not obtain the current time from the system clock.

Synopsis

Declared in <bdlmt_throttle.h>

int
nextPermit(
    bsls::TimeInterval* result,
    int numActions) const;