Class MachineRegistry

Registry for managing and resolving ArvoMachine instances. Provides functionality to store multiple machine instances and resolve them based on events.

The registry must contain at least one machine upon initialization. Each machine in the registry should have a unique combination of version and source.

Implements

Constructors

Properties

Methods

Constructors

Properties

machines: ArvoMachine<any, any, any, any, any>[]

Collection of registered machine instances. Each machine should have a unique combination of version and source.

Methods

  • Resolves and returns a machine instance based on the provided event. The resolution is performed using the orchestrator information in the event's subject.

    Parameters

    • event: ArvoEvent<Record<string, any>, Record<string,
          | null
          | string
          | number
          | boolean>, string>

      The event containing orchestration subject information

    • opentelemetry: ArvoEventHandlerOpenTelemetryOptions = ...

      Telemetry configuration for tracing

    Returns null | ArvoMachine<any, any, any, any, any>

    The matching ArvoMachine instance or null if not found

    const machine = registry.resolve(incomingEvent);
    // Use resolved machine for event processing