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 :
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!