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'; import { type ObservationReconnectBackoffOptions } from '../observation/ObservationReconnectBackoff.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?; private readonly _skipKeepAlive; private readonly _reconnectBackoff; private readonly _logger; private readonly _lifecycle; private readonly _unsubscribeDisconnected; private readonly _reactors; private readonly _queues; private readonly _observations; private readonly _reconnectBackoffs; private readonly _reobserveTimers; 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. * @param _resultHandler - Optional handler for values a reactor handler returns. * @param _eventStore - Optional event store handed to reactor handlers. * @param _artifactActivator - Optional activator creating reactor instances. * @param _skipKeepAlive - Whether the client runs without a keep-alive, which refuses client-hosted reactors. * @param _reconnectBackoff - How a reactor waits before opening its observation stream again after it ended. */ constructor(_clientArtifacts: IClientArtifactsProvider, _connection: ChronicleConnection, _eventStoreName: string, _namespace: string, lifecycle: ConnectionLifecycle, _eventLog: IEventLog, _resultHandler?: ReactorResultHandler | undefined, _eventStore?: IEventStore | undefined, _artifactActivator?: ClientArtifactsActivator | undefined, _skipKeepAlive?: boolean, _reconnectBackoff?: ObservationReconnectBackoffOptions); /** Stops observations permanently when the owning client is disposed. */ dispose(): void; /** @inheritdoc */ discover(): Promise; /** @inheritdoc */ register(): Promise; private startObservation; private runObservation; private reconnectBackoffFor; /** * 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. The delay keeps * a stream that keeps ending from becoming a hot loop, and grows with jitter while * it does (see {@link ObservationReconnectBackoff}). */ private scheduleReobserve; private observeReactor; private streamFailed; private disconnectAll; } //# sourceMappingURL=Reactors.d.ts.map