@bitsinfra/fusee
    Preparing search index...

    Class Workflow<I, O>

    Type Parameters

    • I
    • O
    Index
    • Type Parameters

      • I
      • O

      Parameters

      • engine: Engine
      • name: string
      • version: number

      Returns Workflow<I, O>

    name: string
    version: number
    • Adds an event to the batch under key: once the batch holds maxEvents events or maxWait has passed since its first, one run starts with all of them, in the order they were accepted, as its input (an array). Resolves once the event is durable, with the handle of that run.

      Parameters

      • key: string
      • event: I extends readonly E[] ? E : unknown
      • opts: BatchOptions = {}

      Returns Promise<Run<O>>

    • Debounces a start under key: starts inside the window collapse into one run, which begins with the latest start's input when the window closes (window after the latest start, or maxWait after the first). Resolves once this start is durable, with the handle of that run; the run exists once the window closes (run.started()).

      Parameters

      Returns Promise<Run<O>>

    • Starts a run. Resolves once the start is durable.

      Parameters

      Returns Promise<Run<O>>

    • Starts the workflow if it is not running and delivers an update in the same record; if it is running, delivers the update to it. Returns the update's result once it is durable.

      Type Parameters

      • A
      • R

      Parameters

      Returns Promise<{ result: R; run: Run<O> }>