Safe to run uv_run inside callback?
Hello,
I have a specific problem in a project I have that requires that the event loop be run a couple times from within a callback, and I'm not sure if the bug I'm experiencing is coming from that not being safe or somewhere else in my code. I can't seem to find any docs prohibiting this outright so I just want to make sure.
I'm basically doing a uv_run(loop, UV_RUN_ONCE); from within a callback
Thanks in advance
I can't seem to find any docs prohibiting this outright so I just want to make sure.
I've opened a PR that adds a warning. :-)
The short answer is that you can't, uv_run() isn't reentrant. We've discussed adding that functionality in the past but the conclusion was that it was too much effort and overhead for not enough gain.
Hmm okay, that would explain some of the errors I'm seeing :)
thanks for the help, seems like I may need to refactor a bit