@nivinjoseph/n-eda
Version:
Event Driven Architecture framework
85 lines • 3.9 kB
TypeScript
import { Container, Registry, ServiceLocator, ComponentInstaller } from "@nivinjoseph/n-ject";
import { EventBus } from "./event-bus.js";
import { EventSubMgr } from "./event-sub-mgr.js";
import { ClassDefinition, Disposable } from "@nivinjoseph/n-util";
import { EventRegistration } from "./event-registration.js";
import { Topic } from "./topic.js";
import { EdaEvent } from "./eda-event.js";
import { EdaEventHandler } from "./eda-event-handler.js";
import { AwsLambdaEventHandler } from "./redis-implementation/aws-lambda-event-handler.js";
import { LambdaDetails } from "./lambda-details.js";
import { RpcDetails } from "./rpc-details.js";
import { RpcEventHandler } from "./redis-implementation/rpc-event-handler.js";
import { GrpcEventHandler } from "./redis-implementation/grpc-event-handler.js";
import { GrpcDetails } from "./grpc-details.js";
import { ObserverEdaEventHandler } from "./observer-eda-event-handler.js";
export declare class EdaManager implements Disposable {
private readonly _container;
private readonly _ownsContainer;
private readonly _topics;
private readonly _topicMap;
private readonly _eventMap;
private readonly _observerEventMap;
private _partitionKeyMapper;
private _eventBusRegistered;
private _eventSubMgrRegistered;
private _evtSubMgr;
private _consumerName;
private _consumerGroupId;
private _cleanKeys;
private _distributedObserverTopic;
private _awsLambdaDetails;
private _isAwsLambdaConsumer;
private _awsLambdaEventHandler;
private _rpcDetails;
private _isRpcConsumer;
private _rpcEventHandler;
private _grpcDetails;
private _isGrpcConsumer;
private _grpcEventHandler;
private _isDisposed;
private _disposePromise;
private _isBootstrapped;
static get eventBusKey(): string;
static get eventSubMgrKey(): string;
get containerRegistry(): Registry;
get serviceLocator(): ServiceLocator;
get topics(): ReadonlyArray<Topic>;
get distributedObserverTopic(): Topic | null;
get eventMap(): ReadonlyMap<string, EventRegistration>;
get observerEventMap(): ReadonlyMap<string, EventRegistration>;
get consumerName(): string;
get consumerGroupId(): string | null;
get cleanKeys(): boolean;
get awsLambdaDetails(): LambdaDetails | null;
get awsLambdaProxyEnabled(): boolean;
get isAwsLambdaConsumer(): boolean;
get rpcDetails(): RpcDetails | null;
get rpcProxyEnabled(): boolean;
get isRpcConsumer(): boolean;
get grpcDetails(): GrpcDetails | null;
get grpcProxyEnabled(): boolean;
get isGrpcConsumer(): boolean;
get partitionKeyMapper(): (event: EdaEvent) => string;
constructor(container?: Container);
useInstaller(installer: ComponentInstaller): this;
useConsumerName(name: string): this;
registerTopics(...topics: Array<Topic>): this;
usePartitionKeyMapper(func: (event: EdaEvent) => string): this;
registerEventHandlers(...eventHandlerClasses: Array<ClassDefinition<EdaEventHandler<EdaEvent>> | ClassDefinition<ObserverEdaEventHandler<EdaEvent>>>): this;
registerEventBus(eventBus: EventBus | ClassDefinition<EventBus>): this;
registerEventSubscriptionManager(eventSubMgr: EventSubMgr | ClassDefinition<EventSubMgr>, consumerGroupId: string): this;
cleanUpKeys(): this;
proxyToAwsLambda(lambdaDetails: LambdaDetails): this;
actAsAwsLambdaConsumer(handler: AwsLambdaEventHandler): this;
proxyToRpc(rpcDetails: RpcDetails): this;
actAsRpcConsumer(handler: RpcEventHandler): this;
proxyToGrpc(grpcDetails: GrpcDetails): this;
actAsGrpcConsumer(handler: GrpcEventHandler): this;
enableDistributedObserver(topic: Topic): this;
bootstrap(): void;
beginConsumption(): Promise<void>;
mapToPartition(topic: string, event: EdaEvent): number;
dispose(): Promise<void>;
}
//# sourceMappingURL=eda-manager.d.ts.map