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.
Properties
Section titled “Properties”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.
Returns
Section titled “Returns”Promise<void>
consumeWakeHint
Section titled “consumeWakeHint”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.
Parameters
Section titled “Parameters”typeName
Section titled “typeName”string
Returns
Section titled “Returns”Promise<boolean>
listenChainCompleted
Section titled “listenChainCompleted”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.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
onNotification
Section titled “onNotification”() => void
Returns
Section titled “Returns”Promise<() => Promise<void>>
listenJobAttemptLost
Section titled “listenJobAttemptLost”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.
Parameters
Section titled “Parameters”string
onNotification
Section titled “onNotification”() => void
Returns
Section titled “Returns”Promise<() => Promise<void>>
listenJobScheduled
Section titled “listenJobScheduled”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.
Parameters
Section titled “Parameters”typeNames
Section titled “typeNames”string[]
onNotification
Section titled “onNotification”(typeName) => void
Returns
Section titled “Returns”Promise<() => Promise<void>>
notifyChainCompleted
Section titled “notifyChainCompleted”notifyChainCompleted: (
chainId) =>Promise<void>
Defined in: packages/core/src/notify-adapter/notify-adapter.ts:32
Notify that a chain has completed.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
Returns
Section titled “Returns”Promise<void>
notifyJobAttemptLost
Section titled “notifyJobAttemptLost”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).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
notifyJobScheduled
Section titled “notifyJobScheduled”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.
Parameters
Section titled “Parameters”typeName
Section titled “typeName”string
Returns
Section titled “Returns”Promise<void>
provideWakeHint
Section titled “provideWakeHint”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.
Parameters
Section titled “Parameters”typeName
Section titled “typeName”string
number
Returns
Section titled “Returns”Promise<void>