lib/shared/modules/ms-client/ms-client.types.ts
Interface defining the contract for the message bus.
Methods |
dispatch | ||||||||||||
dispatch(pattern: any, data?: TInput, opts?: MsClientOptions)
|
||||||||||||
Type parameters :
|
||||||||||||
Parameters :
Returns :
Promise<TResult>
|
emit | ||||||||||||
emit(pattern: any, data?: TInput, opts?: MsClientOptions)
|
||||||||||||
Type parameters :
|
||||||||||||
Parameters :
Returns :
Observable<TResult>
|
send | ||||||||||||
send(pattern: any, data?: TInput, opts?: MsClientOptions)
|
||||||||||||
Type parameters :
|
||||||||||||
Parameters :
Returns :
Observable<TResult>
|
import { Observable } from "rxjs";
/**
* Type definition for microservices client options.
*/
export type MsClientOptions = {
timeout: number;
};
/**
* Interface defining the contract for the message bus.
*/
export interface MessageBus {
dispatch<TResult = any, TInput = any>(
pattern: any,
data?: TInput,
opts?: MsClientOptions,
): Promise<TResult>;
send<TResult = any, TInput = any>(
pattern: any,
data?: TInput,
opts?: MsClientOptions,
): Observable<TResult>;
emit<TResult = any, TInput = any>(
pattern: any,
data?: TInput,
opts?: MsClientOptions,
): Observable<TResult>;
}