bunqueue v2.8 API referenceall versions · guide
bunqueue
    Preparing search index...

    Class Engine

    Index
    • async on purpose, even though the work is synchronous: resumeCompensation is async, and an operator writing recovery code under pressure reaches for Promise.allSettled([resume(id), abandon(id)]). With a sync throw that expression throws before allSettled is ever called, so the defensive form is the one that blows up. Matching the sibling costs nothing while the API is experimental.

      Parameters

      • executionId: string

      Returns Promise<void>

    • Shut down the engine

      Parameters

      • force: boolean = false

      Returns Promise<void>

    • Recover orphaned executions after a crash/restart.

      • 'running' executions: re-enqueued at their current step
      • 'waiting' executions: timeout timers re-armed (or resumed if signal arrived)
      • 'compensating' executions: compensation re-run (handlers must be idempotent)

      Returns Promise<RecoverResult>

    • Retry the compensation that parked a compensation-stuck run and continue the unwind. Use once the cause of the failed reversal has been fixed.

      Parameters

      • executionId: string

      Returns Promise<void>

    • Send a signal to a waiting execution

      Parameters

      • executionId: string
      • event: string
      • Optionalpayload: unknown

      Returns Promise<void>