import 'reflect-metadata'; import { IClientArtifactsProvider } from '../artifacts/index.js'; import { ChronicleConnection } from '../connection/index.js'; import { ConnectionLifecycle } from '../connection/ConnectionLifecycle.js'; import { IReducers } from './IReducers.js'; import type { ReadModelNamingPolicy } from '../readModels/ReadModelNamingPolicy.js'; import type { IEventStore } from '../IEventStore.js'; import type { ClientArtifactsActivator } from '../artifacts/ClientArtifactsActivator.js'; import { type ObservationReconnectBackoffOptions } from '../observation/ObservationReconnectBackoff.js'; /** * Implements {@link IReducers}, managing discovery and registration of reducers * with the Chronicle Kernel via bidirectional gRPC streaming. */ export declare class Reducers implements IReducers { private readonly _clientArtifacts; private readonly _connection; private readonly _eventStoreName; private readonly _namespace; private readonly _defaultSinkTypeId; private readonly _eventStore?; private readonly _artifactActivator?; private readonly _readModelNamingPolicy?; private readonly _skipKeepAlive; private readonly _reconnectBackoff; private readonly _logger; private readonly _lifecycle; private readonly _unsubscribeDisconnected; private readonly _reducers; private readonly _queues; private readonly _observations; private readonly _reconnectBackoffs; private readonly _reobserveTimers; private _registered; private _disposed; /** * Creates a new {@link Reducers} 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 _defaultSinkTypeId - The default sink type identifier used when registering read models. * @param _eventStore - The event store handed to reducers that request it. * @param _artifactActivator - Optional per-delivery activator. * @param _readModelNamingPolicy - Optional policy naming the container of each read model. * @param _skipKeepAlive - Whether the client runs without a keep-alive, which refuses client-hosted reducers. * @param _reconnectBackoff - How a reducer waits before opening its observation stream again after it ended. */ constructor(_clientArtifacts: IClientArtifactsProvider, _connection: ChronicleConnection, _eventStoreName: string, _namespace: string, lifecycle: ConnectionLifecycle, _defaultSinkTypeId: string, _eventStore?: IEventStore | undefined, _artifactActivator?: ClientArtifactsActivator | undefined, _readModelNamingPolicy?: ReadModelNamingPolicy | undefined, _skipKeepAlive?: boolean, _reconnectBackoff?: ObservationReconnectBackoffOptions); /** Stops observations permanently when the owning client is disposed. */ dispose(): void; /** @inheritdoc */ discover(): Promise; /** @inheritdoc */ register(): Promise; private registerReadModels; private getReducerSchema; 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) observation's stream rather than tailing it * forever, so a reducer 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 getReducerReadModelIdentifier; private observeReducer; private streamFailed; private createRegistrationMessage; private beginReduction; private reducePartition; private notifyReplayTransition; private notifyActivatedReplayTransition; private requireEventStore; private reduceEvents; private processEvents; private processBatch; private processEvent; private invokeHandler; private disconnectAll; } //# sourceMappingURL=Reducers.d.ts.map