UNPKG

n8n

Version:

n8n Workflow Automation Tool

20 lines (19 loc) 873 B
import type { InstanceAiEvent } from '@n8n/api-types'; import type { InstanceAiEventBus, StoredEvent } from '@n8n/instance-ai'; export declare class InProcessEventBus implements InstanceAiEventBus { private readonly emitter; private readonly store; private readonly sizeBytes; private readonly nextId; constructor(); publish(threadId: string, event: InstanceAiEvent): void; subscribe(threadId: string, handler: (storedEvent: StoredEvent) => void): () => void; getEventsAfter(threadId: string, afterId: number): StoredEvent[]; getEventsForRun(threadId: string, runId: string): InstanceAiEvent[]; getEventsForRuns(threadId: string, runIds: string[]): InstanceAiEvent[]; getNextEventId(threadId: string): number; clearThread(threadId: string): void; clear(): void; private evictIfNeeded; private getOrCreateStore; }