cap-nodejs

CAP Node.js API


CAP Node.js API / cap-core/src / LocalBus

Class: LocalBus

Defined in: cap-core/src/testing/local-bus.ts:18

Implements

Constructors

Constructor

new LocalBus(): LocalBus

Returns

LocalBus

Properties

listeners

readonly listeners: Map<string, Set<Listener>>

Defined in: cap-core/src/testing/local-bus.ts:19

Methods

consume()

consume(topic, _group, handler): Promise<void>

Defined in: cap-core/src/testing/local-bus.ts:44

Parameters

topic

string

_group

string

handler

Listener

Returns

Promise<void>

Implementation of

SubscriberPort.consume


emit()

emit<T>(topic, payload, headers?, metadata?): Promise<void>

Defined in: cap-core/src/testing/local-bus.ts:21

Type Parameters

T

T extends JsonValue = JsonValue

Parameters

topic

string

payload

T

headers?

CapHeaders

metadata?

PublishMetadata

Returns

Promise<void>

Implementation of

PublisherPort.emit