@betit/orion
Version:
Pluggable microservice framework
31 lines (30 loc) • 711 B
TypeScript
import { ClientOptions } from '../types/interfaces';
/**
* Provides an interface to make requests to services.
*/
export default class Client {
private options;
private codec;
private transport;
/**
* Create new client.
*/
constructor(options?: ClientOptions);
/**
* Publish to a topic.
* @param {any} topic
* @param {Object} message
*/
emit(topic: string, message: any): void;
/**
* Call service method.
* @param {Object} request
* @param {Object} [params]
* @param {Function} callback
*/
call(request: any, callback: Function): any;
/**
* Close underlying transport connection.
*/
close(): void;
}