Skip to content

Home > resol-vbus-core-toolbox > utils > StartGate

utils.StartGate class

A start-gate / one-shot barrier synchronization primitive.

Signature:

typescript
export declare class StartGate

Constructors

Constructor

Modifiers

Description

(constructor)()

Create a new instance.

Properties

Property

Modifiers

Type

Description

isDecided

boolean

Indicates whether the state is alread decided.

promise

Promise<void>

The promise used to wait for the decision.

reject

(err: unknown) => void

The reject function to abort the race.

resolve

() => void

The resolve function to "open" the start-gate.

Methods

Method

Modifiers

Description

abort(err)

Abort the race with the provided reason.

open()

Open the start-gate.

wait()

Wait for the start-gate to open.