##// END OF EJS Templates
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version

File last commit:

r59:ba3ff79c2832 default
r146:f3f5c56d3b3e v1.4.0-rc5 default
Show More
interfaces.ts
33 lines | 1.3 KiB | video/mp2t | TypeScriptLexer
cin
working on support commonjs modules format
r59 import { ICancellation } from "../interfaces";
/** interface for message consumers, used to recieve messages from a single endpoint.
*/
export interface IConsumer<T> {
/** Reads the next message from the destination for which the consumer was created.
* @param options A provider specific options.
* @param ct The cancellation token for this operation.
* @returns A recieved message or a promise. If message is prefetched it will
* be returned immediately, otherwise a promise is returned.
*/
read(options?: object, ct?: ICancellation): T | Promise<T>;
}
/** Interface for message produsers, used to send messages to the endpoints.
* The producer can be bound to the particular destination or a destination
* can be specified as an additional option during post if supported.
*/
export interface IProducer<T> {
/** Sends a message
* @param msg The message to send.
* @param options A provider specific options
* @param ct The cancellation token for this operation
*/
post(msg: T, options?: object, ct?: ICancellation): void | Promise<void>;
}
export interface ISession {
start(ct: ICancellation): void;
createConsumer<T = any>(destination: string, options?: object): IConsumer<T>;
createProducer<T = any>(destination: string, options?: object): IProducer<T>;
}