MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/cafsindia/snap.cafsinfotech.in/node_modules/pusher-js/src/core/timeline/timeline_sender.ts
import * as Collections from '../utils/collections';
import Util from '../util';
import base64encode from '../base64';
import Timeline from './timeline';
import Runtime from 'runtime';

export interface TimelineSenderOptions {
  host?: string;
  port?: number;
  path?: string;
}

export default class TimelineSender {
  timeline: Timeline;
  options: TimelineSenderOptions;
  host: string;

  constructor(timeline: Timeline, options: TimelineSenderOptions) {
    this.timeline = timeline;
    this.options = options || {};
  }

  send(useTLS: boolean, callback?: Function) {
    if (this.timeline.isEmpty()) {
      return;
    }

    this.timeline.send(
      Runtime.TimelineTransport.getAgent(this, useTLS),
      callback
    );
  }
}