UNPKG

@bazilio-san/af-stream

Version:
35 lines 1.3 kB
/// <reference types="node" /> import { Buffer } from 'buffer'; import AbstractSender from './AbstractSender'; import { IEventComposite, IRecordsComposite, ISenderConstructorOptions } from '../interfaces'; declare class TCPJSONSender extends AbstractSender { isReady: boolean; private socket; constructor(options: ISenderConstructorOptions); connect(): Promise<boolean>; reconnect(): Promise<boolean>; tryConnect(): Promise<boolean>; isConnected(): boolean; shutdown(): void; canSendNext(): boolean; getTcpHeaderLength({ sessionId, streamId }: { sessionId: string; streamId: string; }): number; /** * Encoding a JSON message containing 1 or more events into a buffer ready to be sent over TCP to WSO2 */ encodeMessage(eventComposite: IEventComposite): Buffer | null; /** * Sending an event package to WSO2 * * @return - buffer.length if the message has been sent, "false" otherwise */ _sendEventsPacket(recordsComposite: IRecordsComposite): Promise<number | boolean>; /** * Sending events to WSO2 */ sendEvents(recordsComposite: IRecordsComposite): Promise<boolean>; } export default TCPJSONSender; //# sourceMappingURL=TCPJSONSender.d.ts.map