Does calling an event without a listener using a callback create a leak?

18 views
Skip to first unread message

Jeremy Darling

unread,
Mar 5, 2012, 2:36:43 PM3/5/12
to Hook.io
This is just a curiosity that I have more than anything, but if I call an event using hook.emit and supply a callback but there is nothing listening on the other end for that event does it cause a leak of any kind?  I would think that it would strand the instance of the callback function since it will never get back a "result" response that will trigger the callback itself.  Or is this one of those occasions where node-weak takes care of letting the GC cleanup these callbacks for us?  In the latter case, what happens when you have a very long running process that may return the result many hours, days later?

As I said, just curious more than anything.  I don't have any issues, nor have I found a case for this happening outside of a development environment.

 - Jeremy

Marak Squires

unread,
Mar 5, 2012, 2:41:04 PM3/5/12
to hoo...@googlegroups.com
node-weak should address this...

You can also disable remote callbacks...

To find memory leaks, try experimenting with the pummel tests:

--
-- 
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.

Reply all
Reply to author
Forward
0 new messages