Class SimpleMachineMemory<T>

In-memory implementation of machine state storage for single-instance NodeJS apps.

Best for: Container apps, request-scoped workflows, testing, demos Not for: Multi-instance deployments, persistent workflows, distributed systems

const memory = new SimpleMachineMemory();
const orchestrator = createArvoOrchestrator({
memory,
executionunits: 1,
machines: [workflow]
});

Type Parameters

  • T extends Record<string, any> = Record<string, any>

Implements

Constructors

Methods

Constructors

Methods

  • Attempts to acquire lock for machine instance

    Parameters

    • id: string

      Machine instance ID

    Returns Promise<boolean>

    Success status of lock acquisition

    When id is empty or undefined

  • Gets stored state for a machine instance

    Parameters

    • id: string

      Machine instance ID

    Returns Promise<null | T>

    State data or null if not found

    When id is empty or undefined

  • Releases lock for machine instance

    Parameters

    • id: string

      Machine instance ID

    Returns Promise<boolean>

    True when lock is released

    When id is empty or undefined

  • Stores state for a machine instance

    Parameters

    • id: string

      Machine instance ID

    • data: T

      State to store

    Returns Promise<void>

    When id is empty/undefined or data is null/undefined