On 08/01/2014 10:28 AM, William Ehlhardt wrote: > On Fri, Aug 1, 2014 at 2:48 AM, Saúl Ibarra Corretgé <[email protected]> wrote: >> It's not. The reason is buried inside how uv_run works, which I need to >> document for once :-S >> >> Basically, you are scheduling a timer for 0ms, which means it's due *now*. >> >> Then, when you call uv_run, the first thing to do is run the due timers, >> so, your timer's callback will be called. > > Right, but I would expect UV_RUN_ONCE to only execute those timers > which were due when uv_run was started, not the ones that became due > while it was running. >
Well, your timer was called when uv_run started its process, because due timers are the first thing to be calculated. If you schedule more timers in other callbacks, they will run on the next iteration. If you think you've found an inconsistency, can you provide a test case? -- Saúl Ibarra Corretgé bettercallsaghul.com
signature.asc
Description: OpenPGP digital signature
