UNPKG

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.

13 lines (12 loc) 724 B
import type { Span } from '@opentelemetry/api'; import { type ArvoEvent } from 'arvo-core'; import type { SyncEventResource } from '../../SyncEventResource'; import type { AcquiredLockStatusType } from '../../SyncEventResource/types'; /** * Acquires an exclusive lock for event processing with validation. * * Attempts to obtain a lock on the event's subject to ensure exclusive access during * processing. Throws if lock cannot be acquired, preventing concurrent modifications. * @throws {TransactionViolation} When lock cannot be acquired */ export declare const acquireLockWithValidation: (syncEventResource: SyncEventResource<Record<string, any>>, event: ArvoEvent, span: Span) => Promise<AcquiredLockStatusType>;