Hello, I'm using a node function callback (in this case, `process.emit(...)`) in a C++ Node.js addon. Whenever the C++ callback method is called, I call the node function with the appropriate arguments. In my case, that would be "eventName" and a buffer of data, for another function to use (tied as a callback to the event "eventName").
Here is the code I'm running, and it works fine : https://gist.github.com/anonymous/60cdc8562c3c6466046b12f8544ad0d1 However, one things bothers me, and it's specifically about the `process.emit` method. I feel like the function called by uv_async_send isn't being executed in node's main event loop. I think this because when running this code in node, the callback I set at line 36 is never called. If I replace "process.emit" by "console.log", it prints my arguments just fine. The fact that "process.emit" will only be reacted to by listeners of the same event loop is what makes me think that the work sent by uv_async_send isn't being run in the main loop. Could someone confirm this and help me fix it so it works like I intend it to? Thanks in advance! -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/0967e557-4182-4388-801f-967e13a46661%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
