Questions tagged [eventemitter]

An event emitter is a platform for triggering and listening for events.

An event emitter is a platform for triggering and listening for events. Different libraries offer different implementations and for different purposes.

960 questions
0
votes
1 answer

Event emitter warning in nodeload

var connect = require('connect'), app = connect(); app.use(connectRoute(function (router) { router.get('/', function (req, res, next) { callFun(res); }) })) app.listen(port); /** callFun…
user87267867
  • 1,409
  • 3
  • 18
  • 25
0
votes
2 answers

Can you use `.apply()` on the emit method of EventEmitter?

I'm trying to do... EventEmitter = require('events').EventEmitter events = new EventEmitter() events.emit.apply(null, ['eventname', 'arg1', 'arg2', 'arg3']) ...but it doesn't seem to work or throw an error, any help?
boom
  • 10,856
  • 9
  • 43
  • 64
0
votes
1 answer

Javascript Asynchronous Events emitting mechanism

I'm trying to run this code in node REPl var E = require('events').EventEmitter; var e = new E(); //controller e.on('msg', function(){ console.log(1) }); //handling (function(){ console.log(0); e.emit('msg'); console.log(2); }());…
IvanM
  • 2,913
  • 2
  • 30
  • 30
0
votes
1 answer

Node.JS Event Emitter - Call On Method Internally

I am writing a program for my beaglebone black to control certain aspects of beer brewing process via a webpage. I am using socket.io to keep communications real-time. To do this, I am passing the socket object to actions located in the hardware…
JoshPeltier
  • 121
  • 2
  • 3
  • 12
0
votes
0 answers

Can't jump into closure in debugger

I'm try read source of EventEmitter. I want jump into closure aliasClosure() which is defined in function alias(name) function alias(name) { return function aliasClosure() { return this[name].apply(this, arguments); …
igor_rb
  • 1,821
  • 1
  • 19
  • 34
0
votes
2 answers

I want an eventemitter that works across a network

I really like the EventEmitter paradigm, and I'd like to use it to communicate between two programs across a network. I came up with my own SockEmitter, but I want to know: am I "doing it wrong(tm)"? Is there some package that will already do this?…
Jared Forsyth
  • 12,808
  • 7
  • 45
  • 54
0
votes
3 answers

possible EventEmitter memory leak detected - nodejs v.0.10.4 - on centos

I'm trying to create simple static file server with Node.js, namely to serve videos as video/mp4 (content-type), for download via http. To note, the files are large (more then 100mb) tried using the package node-serve which is recommended for…
Liam
  • 1
  • 2
0
votes
2 answers

node.js EventEmitter and iife pattern

I have a question specific a bit to inheritance in javascript rather than node.js: // foo.js var events = require('events'); var util = require('util'); var Foo = (function(){ var foo = {}; events.EventEmitter.call(foo); foo.init =…
px5x2
  • 1,495
  • 2
  • 14
  • 29
0
votes
2 answers

Handle all messages from EventEmitter child

I have an object оf inherited from EventEmiter "class". It has many events (emitter.on) and I don't know their names. How can I get their names? And how can I handle ALL events?
Dmitry
  • 7,457
  • 12
  • 57
  • 83
0
votes
0 answers

EventEmitter calls the handler even after removing it

I have two classes named say A and B both has two methods named start and done. I create instance of both the classes. var a = new A(); var b = new B(); I bind start event on b and done event to a. a emits start so b.start is called, and b emits…
Salman
  • 9,299
  • 6
  • 40
  • 73
0
votes
1 answer

Node.js server/client module confusion, EventEmitter woes

I'm trying to write a library which can be used in Node.js or on the client-side. I'm running into two issues: I can't seem to export it correctly. I'm using this doc. MyClass = exports? and exports or @MyClass = {} doesn't seem to work, so I split…
user375566
0
votes
1 answer

Node.js delegating functions to an imported module

Currently I have a Node.js module with the following form : var events = require('events'); var emitter = new events.EventEmitter(); function emitSomething() { emitter.emit("event"); } exports.emitSomething = emitSomething; exports.on =…
ahjmorton
  • 965
  • 1
  • 5
  • 18
0
votes
1 answer

nodejs events prototyping and its scope using that = this

I am trying to develop in Nodejs using its evented system. I've implemented the following code and it passes my tests (using mocha). However, I am not confident that it will work in a production environment because of the the scope of the that…
0
votes
1 answer

Node.js - Event won't fire?

I have some code that is supposed to listen for certain events and handle them, but either the events are never actually emitted, or the listener just never catches them. There are two modules here: the server that listens, and the app that handles…
ChaoticWeg
  • 291
  • 2
  • 15
0
votes
2 answers

TypeError is not thrown in Redis message event

I'm trying to implement an event system. Node subscribes to Redis channel, receives message and calls non-existent method in object. Complete code is here. Simple. http://pastebin.com/8XnbaepE Why error is not thrown? I don't understand this…
Tigran Tokmajyan
  • 1,937
  • 7
  • 25
  • 36