[#BloombergLP-bdlmt-Throttle-initialize-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/Throttle.adoc[Throttle]::initialize
:relfileprefix: ../../../
:mrdocs:

Initialize this throttle using the monotonic clock and specified limits&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;throttle&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
initialize(
    int maxSimultaneousActions,
    xref:BloombergLP/bdlmt/Throttle.adoc[Int64] nanosecondsPerAction,
    std::chrono::steady&lowbar;clock const& clock);
----

== Description

Initialize this `Throttle` to limit the average period of actions permitted to the specified `nanosecondsPerAction`, and the maximum number of simultaneous actions allowed to the specified `maxSimultaneousActions`&period; Use the monotonic system clock to measure time (see &lsqb;&rsqb;Clock&hyphen;Types))&period; The configured throttle will over time limit the average number of actions permitted to a rate of `1 &sol; nanosecondsPerAction`&period; If `maxSimultaneousActions` is 0, the throttle will be configured to permit no actions, otherwise if `nanosecondsPerAction` is 0, the throttle will be configured to permit all actions&period; The behavior is undefined unless `0 &lt;&equals; nanosecondsPerAction`, `0 &lt;&equals; maxSimultaneousActions`, `0 &lt; nanosecondsPerAction &verbar;&verbar; 0 &lt; maxSimultaneousActions`, and `maxSimultaneousActions &ast; nanosecondsPerActionLeak &lt;&equals; LLONG&lowbar;MAX`&period; Note that the behavior for other methods is undefined unless this `Throttle` is initialized (either using one of the overloads of this function, or a `BDLMT&lowbar;THROTTLE&lowbar;INIT` macro) prior to being called&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *maxSimultaneousActions*
| maximum actions allowed at one time
| *nanosecondsPerAction*
| minimum average period between actions
| *clock*
| unused&semi; selects the monotonic system clock
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
