@bitsinfra/fusee
    Preparing search index...

    Class Engine

    Hierarchy

    • CodeHost
      • Engine
    Index
    • get schedules(): { get(name: string): Schedule; list(): Schedule[] }

      The schedules: get(name), and list() of every schedule that exists.

      Returns { get(name: string): Schedule; list(): Schedule[] }

    • Flushes and closes.

      Returns Promise<void>

    • Finishes an async completion from its token; resolves once recorded durably.

      Type Parameters

      • T

      Parameters

      • token: string
      • value: T

      Returns Promise<void>

    • A run's journal as an export file (.fjnl) for Replayer, or null.

      Parameters

      • id: string

      Returns Buffer<ArrayBufferLike> | null

    • Fails an async completion.

      Parameters

      • token: string
      • error: string

      Returns Promise<void>

    • Defines (or resizes) a concurrency and rate limit for steps.

      Parameters

      • name: string
      • spec: { concurrent?: number; perSecond?: number }

      Returns void

    • Permits of a limit held right now.

      Parameters

      • name: string

      Returns number

    • Every limit this engine defined, by name, with its permits now.

      Returns {
          concurrent: number;
          inUse: number;
          name: string;
          perSecond: number;
          waiting: number;
      }[]

    • This process's steps waiting for a permit of a limit right now.

      Parameters

      • name: string

      Returns number

    • Parameters

      • opts: number | { limit?: number; where?: Record<string, unknown> } = 100

      Returns any[]

    • The engine's counters summed over its shards.

      Returns Record<string, number>

    • Registers an object type: its handlers by name, exclusive unless marked with shared. Without handlers, returns a handle to call a type registered elsewhere (with workers, in the workers' module).

      Parameters

      • name: string
      • Optionalhandlers: ObjectHandlers
      • opts: { version?: number } = {}

      Returns ObjectType

    • Key key of object type type.

      Parameters

      • type: string
      • key: string

      Returns ObjectRef

    • Keys of object type type (up to limit per shard).

      Parameters

      • type: string
      • limit: number = 1000

      Returns string[]

    • Type Parameters

      • O

      Parameters

      • id: string

      Returns Run<O>

    • Creates a schedule (or updates its spec) that starts workflow on its cron or interval.

      Type Parameters

      • I

      Parameters

      Returns Promise<Schedule>

    • A handle to an existing schedule.

      Parameters

      • name: string

      Returns Schedule

    • Serves the HTTP API and the web UI on a thread of its own (they call this engine through its event loop; nothing rides the step path). Off loopback a token is required. Returns the URL:

      console.log(engine.serve());   // http://127.0.0.1:7601
      

      Parameters

      • opts: { addr?: string; insecure?: boolean; token?: string } = {}

      Returns string

    • The URL this engine's HTTP API is reached at from outside (behind a proxy): awaitCompletion's url is built from it.

      Parameters

      • url: string

      Returns void

    • Signals the run id, starting it first with input if it is not running: both reach the engine before its next tick, so the signal is recorded before a new run's code first runs.

      Type Parameters

      • I
      • O
      • T

      Parameters

      Returns Promise<Run<O>>

    • Starts a run of wf (a definition or a type name) under workflow ID id; resolves once the start is durable. delay or at starts it later: a durable timer (the run fusee.delay/<id>), then the start; result() waits through the delay.

      Type Parameters

      • I
      • O

      Parameters

      Returns Promise<Run<O>>

    • Registers a workflow type (version 1 unless given). Without a function, returns a handle to start runs of a type registered elsewhere (with workers, in the workers' module).

      Type Parameters

      • I
      • O

      Parameters

      • name: string
      • Optionalfn: WorkflowFn<I, O>
      • opts: { version?: number } = {}

      Returns Workflow<I, O>