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

Type Parameters

TEvents extends Record<string, any[]>

TResponses extends Record<keyof TEvents, any>

call<

Event extends keyof TEvents

>(
event: Event
data: TEvents[Event]
timeoutDuration?: number
) : Promise<TResponses[Event]>

Makes an RPC call

subscribe(
events: (keyof TEvents)[]
) : Promise<void>

Subscribes to the given events

Inherited from: IBaseBroker

unsubscribe(
events: (keyof TEvents)[]
) : Promise<void>

Unsubscribes from the given events

Inherited from: IBaseBroker