On Sun, Nov 12, 2017 at 11:46 PM, Andrew Fedoniouk <[email protected]> wrote: > I have a dll where I am considering to use libuv. That's in Sciter Engine > if that matters ( think of Electron but in embeddable DLL ) > > That dll is able to create windows so work in GUI thread context but it has > no access to main() / WinMain, etc. of host application. > > So there is no place for me to put uv_run() call in its Node.js form. > > Instead I am thinking about using GUI timers: > > bool gui_timer_callback() > { > uv_run(UV_RUN_NOWAIT); > if( uv_loop_alive() ) > request_gui_timer(20ms, gui_timer_callback); > } > > The only question for me is to detect the moment when something has been > added to the loop. > Some callback function attached to the uv_loop_s that gets invoked when > uv_loop_alive() > transitions from false to true. > > In that callback I can start my poll timer: > > void uv_alive_callback(loop) { > request_gui_timer(20ms, gui_timer_callback); // initialize > } > > this will allow me to request timer events only something is in uv_loop_t > tasks lists. > > Any idea of how to do it properly?
https://github.com/libuv/libuv/pull/1568 is a pull request that addresses your use case, if I understand you correctly. It seems to have stalled but maybe you can help push it forward? -- You received this message because you are subscribed to the Google Groups "libuv" 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]. Visit this group at https://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
