cap-nodejs

CAP Node.js API


CAP Node.js API / cap-nest/src / CapSubscribe

Function: CapSubscribe()

CapSubscribe<T>(opts, maybeGroup?): MethodDecorator

Defined in: cap-nest/src/cap/decorators/cap-subscribe.decorator.ts:42

Decorate a method so the CAP worker knows it should be invoked when a message on topic (optionally group) arrives.

@CapSubscribe({ topic: 'user.created', group: 'mail-service' })
async handleUserCreated(evt: UserCreated) { ... }

Type Parameters

T

T = unknown

Parameters

opts

string | CapSubscribeOptions<T>

maybeGroup?

string

Returns

MethodDecorator