ThrottleOptionsBuilder
Это содержимое пока не доступно на вашем языке.
Defined in: src/ThrottleOptions.ts:56
Fluent builder for ThrottleOptionsType:
const throttleOptions = ThrottleOptions.create() .withQps(10) .withBurst(2) .withOnExcess('drop');this.context.throttle(throttleOptions);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ThrottleOptionsBuilder():
ThrottleOptionsBuilder
Returns
Section titled “Returns”ThrottleOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withBurst()
Section titled “withBurst()”withBurst(
burst):this
Defined in: src/ThrottleOptions.ts:68
Bucket capacity. Default: qps (one second of refill).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
withClock()
Section titled “withClock()”withClock(
clock):this
Defined in: src/ThrottleOptions.ts:83
Where the throttle reads the time. Default: the wall clock.
Pass system.clock and a ManualScheduler drives the bucket’s refill, so
a throttling test advances time instead of waiting for it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
withOnExcess()
Section titled “withOnExcess()”withOnExcess(
onExcess):this
Defined in: src/ThrottleOptions.ts:73
What to do when the bucket is empty. Default: 'pause'.
Parameters
Section titled “Parameters”onExcess
Section titled “onExcess”Returns
Section titled “Returns”this
withQps()
Section titled “withQps()”withQps(
qps):this
Defined in: src/ThrottleOptions.ts:63
Token-refill rate, tokens per second (> 0). Infinity removes the throttle.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():ThrottleOptionsBuilder
Defined in: src/ThrottleOptions.ts:58
Start a fresh builder. Equivalent to new ThrottleOptionsBuilder().
Returns
Section titled “Returns”ThrottleOptionsBuilder
