Initialize a new `Emitter`.

@param {Primus|Spark} conn
@return {Emitter} `Emitter` instance
@api public
543002
function Emitter(conn) {
            if (!(this instanceof Emitter)) return new Emitter(conn);
            this.ids = 1;
            this.acks = {};
            this.conn = conn;
            if (this.conn) this.bind();
          }
597252
function Runner(emitter, config) {
  debug('RUNNER INIT');
  var dotStrider = path.join(process.env.HOME || '/', '.strider');
  this.config = _.extend({
    pty: false,
    io: new EventEmitter2({
      wildcard: true
    }),
    processJob: core.process,
    pluginDir: path.join(__dirname, '../node_modules'),
    dataDir: process.env.STRIDER_CLONE_DEST || dotStrider,
    concurrentJobs: parseInt(process.env.CONCURRENT_JOBS || '1', 10) || 1,
    defaultRecentBuilds: parseInt(process.env.DEFAULT_RECENT_BUILDS || '1', 10) || 1
  }, config);
  this.emitter = emitter;
  this.queue = new JobQueue(this.processJob.bind(this), this.config.concurrentJobs);
  this.io = this.config.io;
  this.callbackMap = {};
  this.hooks = [];
  this.jobdata = new JobData(this.io);
  this.attach();
}
1066292
public void init(ParticleEmitter emitter, float life) {
		x = 0;
		this.emitter = emitter;
		y = 0;
		velx = 0;
		vely = 0;
		size = 10;
		type = 0;
		this.originalLife = this.life = life;
		oriented = false;
		scaleY = 1.0f;
	}
1155496
function(conn) {
    var coll = CollMethods.Instance(dbLit, conn);
    var dbMethods = DBMethods(dbLit, conn);
    var dbMethodKeys = Object.keys(dbMethods);

    return {
      getOwnPropertyNames: function() {
        conn.db.collectionNames(conn.flow.add());

        return conn.flow.wait().map(function(obj) {
          var collName = obj.name;
          return collName.substr(collName.indexOf('.') + 1);
        }).concat(dbMethodKeys.map(function(methodName) {
          return util.format('%s(', methodName);
        }));
      },
      getOwnPropertyDescriptor: function(proxy, collectionName) {
        return {
          writable: false,
          enumerable: false,
          configurable: true
        };
      },
      getPropertyDescriptor: function(proxy, collectionName) {
        return this.getOwnPropertyDescriptor(proxy, collectionName);
      },
      get: function(proxy, op1) {
        if (op1 === 'getConn') {
          return function() { return conn; };
        } else if (op1 === '_name') {
          return conn.db.databaseName;
        } else if (op1 === 'toString') {
          return function() { return conn.db.databaseName; };
        }

        if (dbMethodKeys.indexOf(op1) !== -1) {
          return dbMethods[op1];
        }

        var collOps = coll(op1);
        var collOpKeys = Object.keys(collOps);
        var _this = this;
        return Proxy.create({
          getOwnPropertyNames: function() {
            var collNames = _this.getOwnPropertyNames();
            var matchColls = collNames.filter(function(collName) {
              return collName !== op1 &&
                collName.indexOf(op1) !== -1;
            }).map(function(collName) {
              var ext = collName.substr(collName.indexOf('.') + 1);
              var subExt = ext.indexOf(op1);
              if (subExt != -1) {
                return '';
              }
              return ext;
            }).filter(function(collName) {
              return collName.length;
            });
            if (matchColls.length) {
              return matchColls;
            }
            return collOpKeys.map(function(collOpKey) {
              return util.format('%s(', collOpKey);
            });
          },
          getOwnPropertyDescriptor: function(proxy, op) {
            return _this.getOwnPropertyDescriptor(proxy, op);
          },
          getPropertyDescriptor: function(proxy, op) {
            return _this.getPropertyDescriptor(proxy, op);
          },
          get: function(proxy, op2) {
            if (collOpKeys.indexOf(op2) !== -1) {
              return collOps[op2];
            }
            return _this.get(proxy, op1 + '.' + op2);
          }
        });
      }
    };
  }
73247
function createEventTracker (emitter) {
  const events = []
  return {
    on (event, fn) {
      events.push([ event, fn ])
      return emitter.on(event, fn)
    },
    remove () {
      events.forEach(([ event, fn ]) => {
        emitter.off(event, fn)
      })
    }
  }
}
142088
function createDone({ meta, emit, test: t, options, same }) {
  return function ondone(result) {
    let test = null;

    /* istanbul ignore if */
    if (same) {
      test = testsCache[t.title];
    } else {
      test = Object.assign({}, t, result, { isPending: false });
    }

    const { reason, ...testObject } = test;

    /* istanbul ignore if */
    if (options.snapshots) {
      testsCache[test.title] = testObject;
      testsCache[test.title].run = false;
    }

    if (test.isRejected) {
      meta.stats.fail += 1;

      test.reason.stack = cleanup(test.reason.stack);
      emit('fail', meta, test);

      /* istanbul ignore if */
      if (options.snapshots) {
        testsCache[test.title].reason = { stack: reason && reason.stack };
      }
    }
    if (test.isFulfilled) {
      if (test.skip) {
        emit('skip', meta, test);
      } else if (test.todo) {
        emit('todo', meta, test);
      } else {
        meta.stats.pass += 1;
        emit('pass', meta, test);
      }
    }

    emit('afterEach', meta, test);
    return test;
  };
}
733407
function EventEmitter() {
    var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

    _classCallCheck(this, EventEmitter);

    this._events = {};
    if (opts.async) this.emit = emitAsync;
  }
1358277
function (callback) {
            debug('');

            self.eventStore.on('connect', function () {
              self.emit('connect');
            });

            self.eventStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.eventStore.init(callback);
          }
851019
function Connection(socket) {
  events.EventEmitter.call(this);

  // underlying socket
  this._socket = socket;

  // flag whether this connection is paused
  this._paused = false;

  // external or in-process client connection
  this._tcp = (this._socket instanceof Socket);

  // state information
  this._client = new Client(socket);

  this.data = this.data.bind(this);

  this._socket.once('close', this._close.bind(this));
  this._socket.on('data', this.data);

  // using a tcp socket connection
  if(this._tcp) {
    this.encoder = new Encoder({return_buffers: true})
    this.encoder.on('push', onPush.bind(this));
    this.encoder.pipe(this._socket);
    this.decoder = new Decoder({return_buffers: true});
    this.decoder.on('reply', this.decoded.bind(this));
    this.decoder.on('error', this.decoded.bind(this));

    function onSocketError(err) {
      log.warning(err.message);
    }

    this._socket.on('error', onSocketError.bind(this));
  }

  this.onWrite = this.onWrite.bind(this);
}
327986
function StreamHandler(host, port, delimiter) {
	events.EventEmitter.call(this);

	var self = this;
	self.delimiter = delimiter || "\r\n";
	self.host      = host;
	self.port      = port;

	self.buffer    = '';

	self.conn = net.createConnection(self.port, self.host);
	self.conn.setEncoding("utf8");

	self.conn.on('error', function(err) {
		try {
			self.emit('error', 'Stream error: ' + err, err);
		} catch (e) {
			console.log('' + err);
		}
	});
	self.conn.on('data', function(data) {
		self.conn.pause();
		self.buffer += data;
		if (self.buffer.match(/\n/)) {
			var arr = self.buffer.split(self.delimiter);
			//Everything except the last one
			for(var i = 0; i < arr.length - 1; i++) {
				self.emit('line', arr[i]);
			}
			self.buffer = arr[arr.length - 1];
		}
		if (self.conn.readyState == 'open') {
			self.conn.resume();
		}
	});
	self.conn.on('close', function(had_error) {
		if (!had_error && self.buffer.length > 0) {
			self.emit('line', self.buffer);
		}
	});
}
661138
def connect(self, callback, ref=False, position='first',
                before=None, after=None):
        
        self._connect_emitters(True)
        return EventEmitter.connect(self, callback, ref, position,
                                    before, after)
334492
function SocketPeer (opts) {
  var self = this;

  if (!(self instanceof SocketPeer)) {
    return new SocketPeer(opts);
  }

  opts = opts || {};

  EventEmitter.call(self);

  self._connections = {
    socket: {success: 0, error: 0, attempt: 0},
    rtc: {success: 0, error: 0, attempt: 0}
  };
  self.peer = null;
  self.rtcConnected = false;
  self.socketConnected = false;

  extend(self, {
    pairCode: 'pairCode' in opts ? opts.pairCode : null,
    socketFallback: 'socketFallback' in opts ? opts.socketFallback : true,
    socket: 'socket' in opts ? opts.socket : null,
    stream: 'stream' in opts ? opts.stream : null,
    url: 'url' in opts ? opts.url : 'http://localhost',
    reconnect: 'reconnect' in opts ? opts.reconnect : true,
    reconnectDelay: 'reconnectDelay' in opts ? opts.reconnectDelay : 1000,
    timeout: 'timeout' in opts ? opts.timeout : 0,
    autoconnect: 'autoconnect' in opts ? opts.autoconnect : true,
    debug: 'debug' in opts ? opts.debug : false
  }, opts);

  self._debug('New peer');

  self.on('peer.found', function (data) {
    self.socketConnected = true;
    clearTimeout(self._socketConnectTimeout);
    clearTimeout(self._socketReconnectDelayTimeout);
    self._connections.socket.attempt = 0;
    self._connections.socket.success++;

    self.emit('connect');
    if (self._connections.socket.success > 0) {
      self.emit('reconnect');
    }

    self.initiator = data.initiator;

    if (data.initiator) {
      self._send('rtc.connect');
      self._rtcInit();
    }
  });
  self.on('rtc.signal', self._rtcSignal);
  self.on('rtc.connect', function () {
    self._rtcInit();
  });

  self.on('busy', function () {
    self._socketError(new Error('Pair code "' + self.pairCode + '" already in use'));
    self.socket.close();
  });

  if (self.autoconnect) {
    setTimeout(function () {
      self.connect();
    }, 0);
  }
}
218423
function Connection(conn) {
	if(!(this instanceof Connection)) {
		return new Connection(conn);
	}
	var self = this;
	if(!conn) { throw new TypeError("no connection set"); }
	self._connection = conn;
}
474421
function (conn, opts) {
            var self = this;
            return this.__setTransactionIsolation(conn, opts).chain(function () {
                return self.__logConnectionExecute(conn, self.beginTransactionSql);
            });
        }
462609
function init(entry) {  // {{{2
/**
 * Socket constructor
 *
 * @param entry {Object} Media player entry
 *
 * @method constructor
 */

  if ('volumeSocket' in entry) {
    throw O.log.error(this, 'DUPLICIT_VOLUME', entry.toString());
  }
  entry.volumeSocket = this;

  this.entry = entry;

  entry.shard.track(entry.dval.volume, this);
}
1011944
function (emitter, eventPrefix) {
        var self = this,
            oldEmit = emitter.emit;

        eventPrefix = eventPrefix || '';

        emitter.emit = function (name, data) {
            oldEmit.apply(emitter, arguments);
            self.send(eventPrefix + name, data);
        };
        return this;
    }
751342
function (conn, opts) {
            opts = opts || {};
            var s = opts.prepare, self = this;
            if (s) {
                return this.__logConnectionExecute(conn, comb("XA END %s").format(this.literal(s))).chain(function () {
                    return self.__logConnectionExecute(comb("XA PREPARE %s").format(self.literal(s)));
                });
            } else {
                return this._super(arguments);
            }
        }