Refactor de las rutas para lanzarse con node (sin tsx)
This commit is contained in:
12
packages/sim-shared/domain/EventBus.port.ts
Normal file
12
packages/sim-shared/domain/EventBus.port.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ConsumeMessage } from "amqplib";
|
||||
import { DomainEvent, DomainEventSubscriber } from "./DomainEvent.js";
|
||||
|
||||
export interface EventBus {
|
||||
publish(events: Array<DomainEvent>): Promise<void>;
|
||||
// Sacado de NEKI, posiblemente no haga falta
|
||||
addSubscribers(subscribers: Array<DomainEventSubscriber<DomainEvent>>): void;
|
||||
|
||||
consume(queue: string, callback: (msg: ConsumeMessage | null) => void): void;
|
||||
ack(msg: ConsumeMessage): Promise<void>;
|
||||
nack(msg: ConsumeMessage): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user