-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/08/2014 12:00 AM, [email protected] wrote: > Hi, I would like to embed libuv in another runloop. This would be > easier if uv_run supported a blocking mode (e.g. UV_RUN_NONE) that > is otherwise a noop. Basically I would like to be able to block > until the next event but don't acually do anything with the event > (e.g. don't run any callbacks). Then libuv can be embedded like: > > In Main Event Loop: If got signal from bg thread { uv_run(loop, > UV_RUN_NOWAIT); signal bg thread to continue } > > In BG thread: while (uv_run(loop, UV_RUN_NONE) != 0) { send signal > to main event loop thread wait for signal from main loop thread } > > Would something like this work? Is it feasible to implement > something like this for all platforms supported by libuv? Then > uv_backend_fd() could be avoided which isn't cross platform > anyway.
Hi, Making loop embedding is on my list, unfortunately I haven't got there yet. The idea I have in mind is to have a uv_backend_poll function, which just polls for i/o for the given timeout, but doesn't run any callback. The the user could run the loop again with UV_RUN_NOWAIT and all callbacks would be fired. Here is a similar discussion we had a few months ago: https://github.com/joyent/libuv/issues/1246 Cheers, - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTux+JAAoJEEEOVVOum8BZ+FMP/0++DwaBtsQdLcsn8QevSXPs q2q0j37aov48GKxkS1PzZqbkky7/5iT7oKPNX92MDZwsnXzhiYgg7m/kUBPOFMwc QncBSJxQYucv9eWH2hLqxbvElCculNdVNAXeTFb/axclZ/taj58O7M9a3hN56eht 215xgbEkYGxkxa7C06OiOr9GLCjiYsXFJdMPDM+aCI3zTw+N/em2okrxBHTho7v+ qfhBf7NmZUWVvuYBU29UbevSo5JS+lWCIG0pZzlJj/YJSMzU6P+3i91Z00PVNMko Z4RFaG/4/fOMf/f+1YCzAnFNrGwQkWXEubr/JV+DPv1+UnUB1TzmCm1i7B0mKIOT CCPFU62s5IPUNo6q7yH0a7PfpE4mRdQEG8zkrNxIK0AlD2+5Z6avRgBwgFQjB0qi xfxkNroYhJql2cV0BmrPAMGHQh1WBgAOpCjBUfoVPCIgyO1vplAoWunF7KSA11dS Pvs+PcZSYDSAF7g9ftO9aWk35OYwLATP4HBDxg3G8GkG3HbGKPJFyQ/cA7uDhdLb Xwv/19M/emey4T4u0o8TAVzASFWG4JX8zlwzGU3GzSj1/uiQGfGAHzfwzaXYy6i/ mnX8YGcZ4uzAuLq9yfIwRMPc2/QREWaTEEZUOXF2sqKD0a4hd7X00DpmtqrjKsYo kyZXBxi8ZPoRlrSYwSO3 =rPuw -----END PGP SIGNATURE----- -- 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 http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
