{"action":"created","issue":{"url":"https://api.github.com/repos/moteus/lua-lluv/issues/18","labels_url":"https://api.github.com/repos/moteus/lua-lluv/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/moteus/lua-lluv/issues/18/comments","events_url":"https://api.github.com/repos/moteus/lua-lluv/issues/18/events","html_url":"https://github.com/moteus/lua-lluv/issues/18","id":118743108,"number":18,"title":"Timers never called with uv.run(uv.RUN_ONCE)","user":{"login":"tbastos","id":150480,"avatar_url":"https://avatars.githubusercontent.com/u/150480?v=3","gravatar_id":"","url":"https://api.github.com/users/tbastos","html_url":"https://github.com/tbastos","followers_url":"https://api.github.com/users/tbastos/followers","following_url":"https://api.github.com/users/tbastos/following{/other_user}","gists_url":"https://api.github.com/users/tbastos/gists{/gist_id}","starred_url":"https://api.github.com/users/tbastos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbastos/subscriptions","organizations_url":"https://api.github.com/users/tbastos/orgs","repos_url":"https://api.github.com/users/tbastos/repos","events_url":"https://api.github.com/users/tbastos/events{/privacy}","received_events_url":"https://api.github.com/users/tbastos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-25T01:57:26Z","updated_at":"2015-11-25T08:32:21Z","closed_at":null,"body":"Hey, I'm trying to run my event loop interleaved with `uv.run()` like this:\r\n```lua\r\nlocal function run()\r\n  while step() do\r\n    uv.run(uv.RUN_ONCE)\r\n  end\r\nend\r\n```\r\nBut `uv.run(uv.RUN_ONCE)` never calls my callbacks. If I change to `uv.run()` the callbacks are called correctly, but then I cannot call `step()` every loop. Any idea why uv.RUN_ONCE doesn't work?\r\n\r\nI could set an idle callback, but then `uv.run()` would never block to wait for IO, which is something I want. All I want is for `step()` to be called after every uv loop, and uv should block. Any idea? Neither `uv.check()` nor `uv.prepare()` worked as I expected.\r\n\r\nThanks for the help!"},"comment":{"url":"https://api.github.com/repos/moteus/lua-lluv/issues/comments/159533750","html_url":"https://github.com/moteus/lua-lluv/issues/18#issuecomment-159533750","issue_url":"https://api.github.com/repos/moteus/lua-lluv/issues/18","id":159533750,"user":{"login":"moteus","id":1804306,"avatar_url":"https://avatars.githubusercontent.com/u/1804306?v=3","gravatar_id":"","url":"https://api.github.com/users/moteus","html_url":"https://github.com/moteus","followers_url":"https://api.github.com/users/moteus/followers","following_url":"https://api.github.com/users/moteus/following{/other_user}","gists_url":"https://api.github.com/users/moteus/gists{/gist_id}","starred_url":"https://api.github.com/users/moteus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moteus/subscriptions","organizations_url":"https://api.github.com/users/moteus/orgs","repos_url":"https://api.github.com/users/moteus/repos","events_url":"https://api.github.com/users/moteus/events{/privacy}","received_events_url":"https://api.github.com/users/moteus/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T08:32:20Z","updated_at":"2015-11-25T08:32:20Z","body":"Just tested \r\n```Lua\r\nlocal uv = require \"lluv\"\r\n\r\nprint(uv._VERSION)\r\nprint(uv.version())\r\n\r\nuv.timer():start(1000, function()\r\n\tprint \"hello\"\r\nend)\r\n\r\nuv.timer():start(2000, function()\r\n\tprint \"world\"\r\nend)\r\n\r\nlocal i = 0\r\nwhile uv.run(uv.RUN_ONCE) > 0 do\r\n\ti = i + 1\r\n\tprint(i)\r\nend\r\n```\r\noutput is \r\n```\r\n0.1.3-dev\r\n1.7.5\r\nhello\r\n1\r\n2\r\nworld\r\n```"}}