Skip to content

Documentation / @tenancy-node/core / InProcessEventBus

Class: InProcessEventBus ​

Defined in: core/src/events/in-process-event-bus.ts:30

EventBus en el mismo proceso (Observer / Pub-Sub).

Implements ​

Constructors ​

Constructor ​

new InProcessEventBus(deps): InProcessEventBus

Defined in: core/src/events/in-process-event-bus.ts:34

Parameters ​

deps ​

InProcessEventBusDeps

Returns ​

InProcessEventBus

Methods ​

flush() ​

flush(): Promise<void>

Defined in: core/src/events/in-process-event-bus.ts:69

Espera a que terminen los listeners async en curso.

Returns ​

Promise<void>

Implementation of ​

EventBus.flush


hasListeners() ​

hasListeners(type): boolean

Defined in: core/src/events/in-process-event-bus.ts:48

Parameters ​

type ​

string

Returns ​

boolean

Implementation of ​

EventBus.hasListeners


on() ​

on(pattern, listener, options?): () => void

Defined in: core/src/events/in-process-event-bus.ts:36

Registra un listener. pattern puede ser un tipo exacto (tenant.created), un prefijo con comodín (tenant.*) o * para todos. Devuelve la función para quitarlo.

Parameters ​

pattern ​

string

listener ​

EventListener

options? ​

ListenerOptions = {}

Returns ​

() => void

Implementation of ​

EventBus.on


publish() ​

publish(event): Promise<EventEnvelope<unknown, string>>

Defined in: core/src/events/in-process-event-bus.ts:52

Parameters ​

event ​

DomainEvent

Returns ​

Promise<EventEnvelope<unknown, string>>

Implementation of ​

EventBus.publish

Publicado bajo la licencia MIT.