Skip to main content

Function: runTickHook()

runTickHook(hook, counts, logPrefix?, timeoutMs?): Promise<void>

Defined in: packages/workflow-engine/src/kernel/helpers/host-support.ts:696

Calls a host's onTick hook with the counts of the tick that just ran.

The hook gets its own copy of counts: mutating it changes nothing the host returns or reports. A hook that throws or rejects is caught and logged: it never fails the caller.

Without timeoutMs the returned promise settles when the hook does, so a hook that never settles never returns. With it, the call returns once the hook settles or timeoutMs has elapsed, whichever is first; after the bound it logs one warning and leaves the hook running (a later throw or rejection is still caught and logged). timeoutMs must pass assertTimerMs (a number from 1 to 2147483647), or the call rejects with a RangeError; the serverless host checks its onTickTimeoutMs at construction. The Node host does not await the hook at all.

Parameters​

hook​

MaintenanceTickHook | undefined

counts​

MaintenanceTickCounts

logPrefix?​

string = HOST_DEFAULTS.logPrefix

timeoutMs?​

number

Returns​

Promise<void>