@dolittle/sdk.events.handling
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
33 lines • 1.84 kB
TypeScript
import { Logger } from 'winston';
import { IServiceProvider } from '@dolittle/sdk.dependencyinversion';
import { EventContext, EventType, EventTypeMap, ScopeId } from '@dolittle/sdk.events';
import { EventHandlerAlias } from './EventHandlerAlias';
import { EventHandlerId } from './EventHandlerId';
import { EventHandlerSignature } from './EventHandlerSignature';
import { IEventHandler } from './IEventHandler';
/**
* Represents an implementation of {@link IEventHandler}.
*/
export declare class EventHandler extends IEventHandler {
readonly eventHandlerId: EventHandlerId;
readonly scopeId: ScopeId;
readonly partitioned: boolean;
readonly handleMethodsByEventType: EventTypeMap<EventHandlerSignature<any>>;
readonly alias: EventHandlerAlias | undefined;
/** @inheritdoc */
readonly hasAlias: boolean;
/**
* Initializes a new instance of {@link EventHandler}.
* @param {EventHandlerId} eventHandlerId - The unique identifier of the event handler.
* @param {ScopeId} scopeId - The identifier of the scope the event handler is in.
* @param {boolean} partitioned - Whether or not the event handler is partitioned.
* @param {EventTypeMap<EventHandlerSignature<any>>} handleMethodsByEventType - Handle methods per event type.
* @param {EventHandlerAlias | undefined} alias - The optional event handler alias.
*/
constructor(eventHandlerId: EventHandlerId, scopeId: ScopeId, partitioned: boolean, handleMethodsByEventType: EventTypeMap<EventHandlerSignature<any>>, alias?: EventHandlerAlias | undefined);
/** @inheritdoc */
get handledEvents(): Iterable<EventType>;
/** @inheritdoc */
handle(event: any, eventType: EventType, context: EventContext, services: IServiceProvider, logger: Logger): Promise<void>;
}
//# sourceMappingURL=EventHandler.d.ts.map