[#BloombergLP-bdlmt-Throttle-requestPermissionIfValid-01] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/Throttle.adoc[Throttle]::requestPermissionIfValid :relfileprefix: ../../../ :mrdocs: `requestPermissionIfValid` overloads == Synopses Declared in `<bdlmt_throttle.h>` Set the specified `*result` to `true` if the time debt incurred by taking the specified `numActions` would _not_ exceed the maximum allowed time debt configured for this `Throttle` object (`nanosecondsPerAction * maxSimultaneousActions`), and set `*result` to `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. If `*result` is set to `true` then `numActions * nanosecondsPerAction` is added to the time debt accumulated by this component. Return 0 if `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, and a non‐zero value otherwise. 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). Note that unless 0 is returned, `*result` is unaffected. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/bdlmt/Throttle/requestPermissionIfValid-0b.adoc[requestPermissionIfValid]( bool* result, int numActions); ---- [.small]#xref:BloombergLP/bdlmt/Throttle/requestPermissionIfValid-0b.adoc[_» more..._]# Same as the preceding overload, using the specified `now`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/bdlmt/Throttle/requestPermissionIfValid-03.adoc[requestPermissionIfValid]( bool* result, int numActions, xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& now); ---- [.small]#xref:BloombergLP/bdlmt/Throttle/requestPermissionIfValid-03.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#