arvo-event-handler
Version:
Type-safe event handler system with versioning, telemetry, and contract validation for distributed Arvo event-driven architectures, featuring routing and multi-handler support.
33 lines (32 loc) • 1.36 kB
TypeScript
import { ArvoOrchestrator } from '.';
import type { CreateArvoOrchestratorParam } from './types';
/**
* Creates a new Arvo orchestrator instance with default components.
*
* Factory function that constructs an orchestrator with standard execution engine
* and registry implementations. Validates that all machines share the same source
* identifier and have unique versions.
*
* @param params - Configuration parameters for the orchestrator
* @returns Configured ArvoOrchestrator instance ready for event handling
*
* @throws {Error} When no machines are provided
* @throws {ConfigViolation} When machines have different source identifiers
* @throws {ConfigViolation} When machines have duplicate versions
*
* @example
* ```typescript
* const orchestrator = createArvoOrchestrator({
* memory: new SimpleMachineMemory(),
* executionunits: 1,
* machines: [userOnboardingMachine, paymentMachine]
* });
*
* // Process events
* const result = await orchestrator.execute(event);
* ```
*
* @see {@link setupArvoMachine} for creating machine definitions
* @see {@link ArvoOrchestrator} for direct instantiation with custom components
*/
export declare const createArvoOrchestrator: ({ executionunits, memory, machines, systemErrorDomain, spanOptions, requiresResourceLocking: _locking, }: CreateArvoOrchestratorParam) => ArvoOrchestrator;