/ fm / liveswitch / ManagedCountdownLatch
Class: ManagedCountdownLatch
fm.liveswitch.ManagedCountdownLatch
A countdown latch that will signal when the counter reaches zero.
Table of contents
Constructors
Methods
Constructors
constructor
+ new ManagedCountdownLatch(): ManagedCountdownLatch
Creates a new instance of the latch with an unknown count. This will cause the latch to count into the negatives until SetCount is called.
Returns: ManagedCountdownLatch
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:15
+ new ManagedCountdownLatch(initialCount
: number): ManagedCountdownLatch
Creates a new instance of the latch with a count.
Parameters:
Name | Type | Description |
---|---|---|
initialCount |
number | The initial counter value. |
Returns: ManagedCountdownLatch
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:23
Methods
decrement
▸ decrement(): void
Decrements the counter by one and signals if it reaches zero.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:52
getCount
▸ getCount(): number
Gets the current count on the latch.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:66
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:9
reset
▸ reset(): void
Resets the latch with an unknown count. This will cause the latch to count into the negatives until SetCount is called.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:79
▸ reset(initialCount
: number): void
Resets the latch with a count.
Parameters:
Name | Type | Description |
---|---|---|
initialCount |
number | The initial counter value. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:86
setCount
▸ setCount(count
: number): void
Sets the counter for the latch. This brings the count back up into positive numbers.
Parameters:
Name | Type |
---|---|
count |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:105
toString
▸ toString(): string
Generates a string description of this instance.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:120
waitAsync
▸ waitAsync(): Future<Object>
Returns a promise that resolves once the counter reaches zero.
Returns: Future<Object>
Defined in: Generated/TypeScript/fm.liveswitch/ManagedCountdownLatch.ts:132