How to use the events.call function in events

To help you get started, we’ve selected a few events examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Streampunk / macadam / index.js View on Github external
}).catch(err => { this.emit('error', err); });
    /* process.on('exit', function () {
      console.log('Exiting node.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit(0);
    }); */
    process.on('SIGINT', () => {
      console.log('Received SIGINT.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit();
    });
  }

  EventEmitter.call(this);
}
github avajs / atom-ava / lib / test-runner-process.js View on Github external
constructor(
		executor = new TerminalCommandExecutor(),
		parserFactory = new ParserFactory()) {
		super();

		this.eventHandlers = {};
		this.parserFactory = parserFactory;
		this.terminalCommandExecutor = executor;

		this.terminalCommandExecutor.on('dataReceived', data => this._addAvaOutput(data));
		this.terminalCommandExecutor.on('dataFinished', () => this._endAvaOutput());

		EventEmitter.call(this);
	}
github derwish-pro / singlehub / src / modules / mysensors / gateway.ts View on Github external
function Gateway() {
    eventEmitter.call(this);

    this.nodes = [];
    this.isConnected = false;
}
util.inherits(Gateway, eventEmitter);
github pmq20 / node-packer / node8 / lib / internal / child_process.js View on Github external
function ChildProcess() {
  EventEmitter.call(this);

  this._closesNeeded = 1;
  this._closesGot = 0;
  this.connected = false;

  this.signalCode = null;
  this.exitCode = null;
  this.killed = false;
  this.spawnfile = null;

  this._handle = new Process();
  this._handle.owner = this;

  this._handle.onexit = (exitCode, signalCode) => {
    if (signalCode) {
      this.signalCode = signalCode;
github dadi / cache / lib / redis.js View on Github external
function RedisCache (options) {
  this.options = options
  this.ttl = options.ttl || 3600
  this.redisClient = this.initialise(options)
  this.ready = false

  EventEmitter.call(this)
}
github nginx / unit / src / nodejs / unit-http / http_server.js View on Github external
function ServerResponse(req) {
    EventEmitter.call(this);

    this.headers = {};
}
util.inherits(ServerResponse, EventEmitter);
github yodaos-project / yoda.js / runtime / app / ext-app.js View on Github external
function EventBus (appBridge, socket, appId, options) {
  EventEmitter.call(this)
  this.bridge = appBridge
  this.socket = socket
  this.appId = appId
  this.pid = socket.pid
  this.logger = require('logger')(`bus-${this.pid}`)
  this.options = options
  this.aliveTimer = null

  /**
   * keep records of subscribed events to deduplicate subscription requests.
   */
  this.subscriptionTable = {}

  this.eventSynTable = {}
  this.eventSyn = 0
github dcposch / webtorrent-remote / client.js View on Github external
function WebTorrentRemoteClient (send, opts) {
  EventEmitter.call(this)
  if (!opts) opts = {}

  this._send = send

  this.clientKey = generateUniqueKey()
  this.torrents = {}

  this._destroyed = false

  var heartbeat = opts.heartbeat != null ? opts.heartbeat : 5000
  if (heartbeat > 0) {
    this._interval = setInterval(sendHeartbeat.bind(null, this), heartbeat)
  }
}
github nodekit-io / nodekit-darwin / src / nodekit / NKCore / lib-core / node / domain.js View on Github external
function Domain() {
  EventEmitter.call(this);

  this.members = [];
}