import { LastTimeRecords } from './LastTimeRecords'; import { RecordsBuffer } from './RecordsBuffer'; import { VirtualTimeObj } from './VirtualTimeObj'; import { ICommonConfig, ISender, ISenderConfig, IStreamConfig, IStreamStat, TDbRecord, TEventRecord } from './interfaces'; import { DbMsSql } from './db/DbMsSql'; import { DbPostgres } from './db/DbPostgres'; export interface IStreamConstructorOptions { commonConfig: ICommonConfig; streamConfig: IStreamConfig; senderConfig: ISenderConfig; virtualTimeObj: VirtualTimeObj; } export declare class Stream { options: IStreamConstructorOptions; id: string; color: string; /** * Timestamp of the last loaded record */ lastRecordTs: number; /** * Left border for next request */ nextStartTs: number; recordsBuffer: RecordsBuffer; lastTimeRecords: LastTimeRecords; virtualTimeObj: VirtualTimeObj; sender: ISender; readonly sessionId: string; db: DbMsSql | DbPostgres; locked: boolean; private busy; private _sendTimer; private _sendInterval; private _printTimer; private _fetchLoopTimer; /** * The interval for sending data from the buffer multiplied by the speed of virtual time */ sendIntervalVirtualMillis: number; totalRowsSent: number; private tsFieldToMillis; private prepareEvent; private initialized; private isFirstLoad; private prevLastRecordTs; private noRecordsQueryCounter; prefix: string; stat: IStreamStat; private isPrepareEventAsync; private destroyed; eeListeners: { [eventId: string]: (...args: any[]) => any; }; gapEdge: number; constructor(options: IStreamConstructorOptions); setParam(paramName: string, value?: number): number; setEventCallback(eventCallback: Function): void; resetSendIntervalVirtualMillis(): void; /** * Preparing entities for the flow to work * - determination of the given speed of the flow of virtual time * - determination of start time * - initializing the sender and checking the connection with the receiver * - initializing VirtualTimeObj (the object will be initialized in a locked state) * - connection to database source * * Output of start information */ init(): Promise; /** * Запуск */ start(): Promise; findEndIndex(vt: number): number; static packetInfo(count: number, fromRecord?: TEventRecord | null, toRecord?: TEventRecord | null): string; prepareEventsPacket(dbRecordOrRecordset: (TDbRecord | null)[]): Promise; _addPortionToBuffer(recordset: TDbRecord[]): Promise; getBufferLookAhead(): number; private _loadNextPortion; private skipGap; private _fetchLoop; private _printInfoLoop; _sendPacket(eventsPacket: TEventRecord[]): Promise<{ debugMessage: string; isError?: boolean; }>; private _send; private _sendLoop; lock(lockVirtualTime?: boolean): void; unLock(unlockVirtualTime?: boolean): void; getDesiredTimeFront(timeFront: number, timeShift: number): number; getActualConfig(asString?: boolean): string | { streamConfig: IStreamConfig; senderConfig: ISenderConfig; }; stop(options?: { noResetVirtualTimeObj?: boolean; }): void; destroy(): Promise; } //# sourceMappingURL=Stream.d.ts.map