Skip to content

NotifyAdapter

NotifyAdapter = object

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:7

Adapter for pub/sub notifications between workers and clients.

Notifications are hints — the system works correctly even if they are lost or duplicated. All listen* methods return a dispose function to unsubscribe.

close: () => Promise<void>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:47

Releases internal resources (shared subscriptions, listener registries) and cascades into the underlying provider. Idempotent — the second call is a no-op. After close, notify*/listen* calls reject.

Promise<void>


consumeWakeHint: (typeName) => Promise<boolean>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:30

Atomically claim one slot of the budget for typeName. Returns true if a slot was claimed (caller should wake) or no budget is currently tracked (graceful degradation: caller wakes). Returns false only when an explicit budget was set and is now exhausted by other consumers. Adapters without hint support always return true.

string

Promise<boolean>


listenChainCompleted: (chainId, onNotification) => Promise<() => Promise<void>>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:34

Listen for a specific chain’s completion. Returns a dispose function.

string

() => void

Promise<() => Promise<void>>


listenJobAttemptLost: (jobId, onNotification) => Promise<() => Promise<void>>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:41

Listen for attempt loss on a specific job. Returns a dispose function.

string

() => void

Promise<() => Promise<void>>


listenJobScheduled: (typeNames, onNotification) => Promise<() => Promise<void>>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:11

Listen for job scheduling notifications. Returns a dispose function.

string[]

(typeName) => void

Promise<() => Promise<void>>


notifyChainCompleted: (chainId) => Promise<void>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:32

Notify that a chain has completed.

string

Promise<void>


notifyJobAttemptLost: (jobId) => Promise<void>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:39

Notify that a job’s attempt has been lost (e.g. attempt expired or workerless completion).

string

Promise<void>


notifyJobScheduled: (typeName) => Promise<void>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:9

Notify that jobs of the given type are available for processing.

string

Promise<void>


provideWakeHint: (typeName, count) => Promise<void>

Defined in: packages/core/src/notify-adapter/notify-adapter.ts:22

Add count wakeups to the budget for typeName. Budgets compose additively across concurrent publishers — calling provideWakeHint(t, 3) twice yields a budget of 6. Adapters without hint support implement this as a no-op. Call before notifyJobScheduled so the budget exists by the time listeners receive the notification.

string

number

Promise<void>