BloombergLP::bdlmt::Throttle::requestPermission

requestPermission overloads

Synopses

Declared in <bdlmt_throttle.h>

Return true if the time debt incurred by taking the indicated action(s) would not exceed the maximum allowed time debt configured for this Throttle object (nanosecondsPerAction * maxSimultaneousActions), and false otherwise. Optionally specify now indicating the current time of the system clock for which this object is configured (now is a offset from that clocks epoch). If now is not supplied, the current time is obtained from the configured system clock. Optionally specify numActions indicating the number of actions requested. If numActions is not supplied, one action is requested. If this function returns true then numActions * nanosecondsPerAction is added to the time debt accumulated by this component. The behavior is undefined unless this throttle has been initialized (either by calling an overload of initialize or using one of the BDLMT_THROTTLE_INIT* macros), 0 < numActions, (numActions <= maxSimultaneousActions or 0 == maxSimultaneousActions), and the value of now, if specified, can be expressed in nanoseconds as a 64-bit signed integer. Note that requestPermissionIfValid, unlike these methods, does not have any preconditions on the value of numActions.

bool
requestPermission();
» more...

Same as the preceding overload, for the specified numActions.

bool
requestPermission(int numActions);
» more...

Same as the preceding overload, using the specified now.

bool
requestPermission(bsls::TimeInterval const& now);
» more...

Same as the preceding overload, using the specified now.

bool
requestPermission(
    int numActions,
    bsls::TimeInterval const& now);
» more...