UNPKG

smart-saga-pattern

Version:

A library implementing the Saga pattern for microservice architecture

24 lines (23 loc) 624 B
import { SagaEvent } from '../types'; /** * Interface for publishing events in a Saga */ export interface EventPublisher { /** * Publishes an event * @param topic Topic to publish to * @param event Event to publish */ publish(topic: string, event: SagaEvent): Promise<void>; } /** * Base implementation of EventPublisher */ export declare abstract class BaseEventPublisher implements EventPublisher { /** * Publishes an event * @param topic Topic to publish to * @param event Event to publish */ abstract publish(topic: string, event: SagaEvent): Promise<void>; }