UNPKG

@betit/orion

Version:

Pluggable microservice framework

34 lines (33 loc) 988 B
export interface Codec { encoding?: string; contentType?: string; encode(data: any): any; decode(data: any): any; } export interface Transport { listen(callback: Function): any; publish(topic: string, message: any): any; subscribe(topic: string, group: string, callback: Function): any; handle(route: string, group: string, callback: Function): any; request(route: string, payload: any, callback: Function, timeout: number): any; close(): any; } export interface Service { emit(topic: string, message: any): any; on(topic: string, callback: Function): any; handle(method: string, callback: Function): any; } export interface ServiceOptions { codec?: Codec; transport?: Transport; } export interface Client { emit(topic: string, message: any): any; call(request: any, callback: Function): any; } export interface ClientOptions { service?: string; timeout?: number; codec?: Codec; transport?: Transport; }