Search...

IRPCBroker

export interface IRPCBroker<TEvents extends Record<string, any>, TResponses extends Record<keyof TEvents, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents, TResponses>> 
export interface IRPCBroker<TEvents extends Record<string, any>, TResponses extends Record<keyof TEvents, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents, TResponses>> 

No summary provided.

Extends

IBaseBroker<TEvents>AsyncEventEmitter<ToEventMap<TEvents, TResponses>>
NameConstraintsOptionalDefaultDescription
TEventsRecord<string, any>NoNone
TResponsesRecord<keyof TEvents, any>NoNone

call(event, data, timeoutDuration?)

:

Promise<TResponses[T]>

Makes an RPC call
NameTypeOptionalDescription
eventTNoNone
dataTEvents[T]NoNone
timeoutDurationnumberYesNone

subscribe(group, events)

:

Promise<void>

Subscribes to the given events, grouping them by the given group name
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker

unsubscribe(group, events)

:

Promise<void>

Unsubscribes from the given events - it's required to pass the same group name as when subscribing for proper cleanup
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker