Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/operation-graph > WatchLoop

WatchLoop class

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

This class implements a watch loop.

Signature:

export declare class WatchLoop implements IWatchLoopState 

Implements: IWatchLoopState

Constructors

Constructor

Modifiers

Description

(constructor)(options)

(BETA) Constructs a new instance of the WatchLoop class

Properties

Property

Modifiers

Type

Description

abortSignal

readonly

AbortSignal

(BETA) The abort signal for the current iteration.

requestRun

OperationRequestRunCallback

(BETA) Requests that a new run occur.

Methods

Method

Modifiers

Description

runIPCAsync(host)

(BETA) Sets up an IPC handler that will run the inner loop when it receives a "run" message from the host. Runs until receiving an "exit" message from the host, or aborts early if an unhandled error is thrown.

runUntilAbortedAsync(abortSignal, onWaiting)

(BETA) Runs the inner loop until the abort signal is aborted. Will otherwise wait indefinitely for a new run to be requested.

runUntilStableAsync(abortSignal)

(BETA) Runs the inner loop until the abort signal is cancelled or a run completes without a new run being requested.