import 'reflect-metadata'; import { IClientArtifactsProvider } from '../artifacts/index.js'; import { ChronicleConnection } from '../connection/index.js'; import { ConnectionLifecycle } from '../connection/ConnectionLifecycle.js'; import type { IEventLog } from '../eventSequences/IEventLog.js'; import { IReactors } from './IReactors.js'; import type { ReactorResultHandler } from './ReactorResultHandler.js'; import type { IEventStore } from '../IEventStore.js'; import type { ClientArtifactsActivator } from '../artifacts/ClientArtifactsActivator.js'; /** * Implements {@link IReactors}, managing discovery and registration of reactors * with the Chronicle Kernel via bidirectional gRPC streaming. */ export declare class Reactors implements IReactors { private readonly _clientArtifacts; private readonly _connection; private readonly _eventStoreName; private readonly _namespace; private readonly _eventLog; private readonly _resultHandler?; private readonly _eventStore?; private readonly _artifactActivator?; /** How long to wait before re-establishing an observation whose stream ended. */ private static readonly _reobserveDelayMs; private readonly _logger; private readonly _lifecycle; private readonly _unsubscribeDisconnected; private readonly _reactors; private readonly _queues; private readonly _observations; private _registered; private _disposed; /** * Creates a new {@link Reactors} instance. * @param _clientArtifacts - Provider for discovered client artifact types. * @param _connection - The Chronicle gRPC connection. * @param _eventStoreName - The name of the event store. * @param _namespace - The namespace within the event store. * @param lifecycle - The connection lifecycle used to react to disconnect events. * @param _eventLog - The event log used to append side-effect events a reactor handler returns. */ constructor(_clientArtifacts: IClientArtifactsProvider, _connection: ChronicleConnection, _eventStoreName: string, _namespace: string, lifecycle: ConnectionLifecycle, _eventLog: IEventLog, _resultHandler?: ReactorResultHandler | undefined, _eventStore?: IEventStore | undefined, _artifactActivator?: ClientArtifactsActivator | undefined); /** Stops observations permanently when the owning client is disposed. */ dispose(): void; /** @inheritdoc */ discover(): Promise; /** @inheritdoc */ register(): Promise; private startObservation; private runObservation; /** * Re-establishes an observation whose stream ended. * * The stream ending without an error is not proof that all is well — the kernel * closes a cross-store (inbox) reactor's stream rather than tailing it forever, * so a reactor that does not re-subscribe there silently stops observing until * the whole client reconnects. Both endings are therefore retried, and the delay * keeps a stream that keeps ending from becoming a hot loop. */ private scheduleReobserve; private observeReactor; private disconnectAll; } //# sourceMappingURL=Reactors.d.ts.map