spawn-ts API reference - v0.6.0
    Preparing search index...

    Class MockProvider

    Implements

    Index
    isReal: false

    Whether this provider touches real, billable resources. Drives UI warnings.

    label: "mock"

    Human label for the active backend, shown in the UI ("mock", "aws:us-east-1", "substrate").

    • Hibernate (RAM saved to disk).

      Parameters

      • instanceId: string

      Returns Promise<void>

    • List all spawn-managed instances (spawn:managed=true), excluding terminated by default.

      Parameters

      • includeTerminated: boolean = false

      Returns Promise<ManagedInstance[]>

    • Overwrite/merge tags on an instance. Used by extend to push out spawn:ttl-deadline, and by the sim to update spawn:compute-seconds.

      Parameters

      • instanceId: string
      • tags: Record<string, string>

      Returns Promise<void>

    • Advance the simulated world to nowMs: accrue compute-seconds for running instances since their last-known point, and optionally mark them busy/idle. The UI's sim loop calls this, then runs the lifecycle engine over the result.

      Parameters

      • nowMs: number
      • prevMs: number
      • opts: { busy?: (i: ManagedInstance) => boolean } = {}

      Returns void

    • Start a stopped/hibernated instance.

      Parameters

      • instanceId: string

      Returns Promise<void>

    • Stop (billing pauses, EBS persists).

      Parameters

      • instanceId: string

      Returns Promise<void>

    • Terminate (permanent).

      Parameters

      • instanceId: string

      Returns Promise<void>