Return the estimated wait before one more unit can be submitted.
Synopsis
Declared in <balb_ratelimiter.h>
bsls::TimeInterval
calculateTimeToSubmit(bsls::TimeInterval const& currentTime);
Description
Update the state of this rate limiter to the specified currentTime. Return the estimated time interval that should pass from currentTime until 1 more unit can be submitted to this rate limiter without exceeding its configured limits. The number of nanoseconds in the returned time interval is rounded up. Note that a time interval of 0 is returned if 1 or more units can be submitted at currentTime. Also note that after waiting for the returned time interval, clients should typically check again using this method, because additional units may have been submitted in the interim.
Return Value
estimated wait until 1 more unit can be submitted
Parameters
Name |
Description |
currentTime |
time used to update and measure against this limiter |
Created with MrDocs