Mechanism that regulates the frequency at which actions may be taken.

Synopsis

Declared in <bdlmt_throttle.h>

class Throttle;

Description

This class provides a mechanism that can be used by clients to regulate the frequency at which actions can be taken. The data members of Throttle are currently public to allow for compile‐time (aggregate) initialization of Throttle objects having static storage duration (for C++03 compilers that do not provide constexpr).

Member Functions

Name

Description

clockType

Return the system clock type with which this Throttle is configured to observe the passage of time.

initialize

initialize overloads

maxSimultaneousActions

Return the maximum number of simultaneous actions for which this Throttle is configured to permit.

nanosecondsPerAction

Return the time debt, in nanoseconds, that this Throttle is configured to incur for each action permitted.

nextPermit

Load the earliest time when the specified actions will be permitted.

requestPermission

requestPermission overloads

requestPermissionIfValid

requestPermissionIfValid overloads

Data Members

Name

Description

d_clockType

Clock type (monotonic or realtime) used by this throttle.

d_maxSimultaneousActions

Total bucket capacity expressed in actions.

d_nanosecondsPerAction

Nanoseconds consumed by each sustained action.

d_nanosecondsPerTotalReset

Total bucket capacity expressed in nanoseconds.

d_prevLeakTime

Effective time of the previous leak operation.

Static Data Members

Name

Description

k_TEN_YEARS_NANOSECONDS

Ten years expressed in nanoseconds.

Friends

Name

Description

BloombergLP::bdlmt::Throttle_InitHelper

Private helper that validates compile‐time throttle initialization arguments.

Created with MrDocs