Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).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);
}
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);
}
function Gateway() {
eventEmitter.call(this);
this.nodes = [];
this.isConnected = false;
}
util.inherits(Gateway, eventEmitter);
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;
function RedisCache (options) {
this.options = options
this.ttl = options.ttl || 3600
this.redisClient = this.initialise(options)
this.ready = false
EventEmitter.call(this)
}
function ServerResponse(req) {
EventEmitter.call(this);
this.headers = {};
}
util.inherits(ServerResponse, EventEmitter);
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
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)
}
}
function Domain() {
EventEmitter.call(this);
this.members = [];
}
function Scraper () {
EventEmitter.call(this);
}