{"action":"created","issue":{"url":"https://api.github.com/repos/jpaulm/jsfbp/issues/12","labels_url":"https://api.github.com/repos/jpaulm/jsfbp/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/jpaulm/jsfbp/issues/12/comments","events_url":"https://api.github.com/repos/jpaulm/jsfbp/issues/12/events","html_url":"https://github.com/jpaulm/jsfbp/issues/12","id":57377254,"number":12,"title":"randdelay doesn't actually delay","user":{"login":"tlrobinson","id":18193,"avatar_url":"https://avatars.githubusercontent.com/u/18193?v=3","gravatar_id":"","url":"https://api.github.com/users/tlrobinson","html_url":"https://github.com/tlrobinson","followers_url":"https://api.github.com/users/tlrobinson/followers","following_url":"https://api.github.com/users/tlrobinson/following{/other_user}","gists_url":"https://api.github.com/users/tlrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tlrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlrobinson/subscriptions","organizations_url":"https://api.github.com/users/tlrobinson/orgs","repos_url":"https://api.github.com/users/tlrobinson/repos","events_url":"https://api.github.com/users/tlrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/tlrobinson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":58,"created_at":"2015-02-11T21:07:07Z","updated_at":"2015-03-01T14:24:46Z","closed_at":"2015-02-28T14:54:35Z","body":"setTimeout is an asynchronous operation (the passed in callback gets called after the delay), so this doesn't actually delay anything: https://github.com/jpaulm/jsfbp/blob/master/script/randdelay.js#L24-L28\r\n\r\nI'm not sure what the correct implementation should be. I tried something like this https://github.com/laverdet/node-fibers#sleep which seemed to correctly delay, but then the process never exits."},"comment":{"url":"https://api.github.com/repos/jpaulm/jsfbp/issues/comments/76598836","html_url":"https://github.com/jpaulm/jsfbp/issues/12#issuecomment-76598836","issue_url":"https://api.github.com/repos/jpaulm/jsfbp/issues/12","id":76598836,"user":{"login":"jpaulm","id":312871,"avatar_url":"https://avatars.githubusercontent.com/u/312871?v=3","gravatar_id":"","url":"https://api.github.com/users/jpaulm","html_url":"https://github.com/jpaulm","followers_url":"https://api.github.com/users/jpaulm/followers","following_url":"https://api.github.com/users/jpaulm/following{/other_user}","gists_url":"https://api.github.com/users/jpaulm/gists{/gist_id}","starred_url":"https://api.github.com/users/jpaulm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpaulm/subscriptions","organizations_url":"https://api.github.com/users/jpaulm/orgs","repos_url":"https://api.github.com/users/jpaulm/repos","events_url":"https://api.github.com/users/jpaulm/events{/privacy}","received_events_url":"https://api.github.com/users/jpaulm/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T14:24:46Z","updated_at":"2015-03-01T14:24:46Z","body":"Hi @comfreek Your explanation felt right, but then I realized that I only\nadd a process to the Ready Queue if it has the appropriate status.\n\nInputPort lines 54, 89\n\nOutputPort lines 31-33\n\nI feel we are on the right track - or maybe I jumped to conclusions reading\nyour note.  What lines did you actually change?\n\nRegards,\n\nPaul\nOn Feb 28, 2015 3:27 PM, \"Kenneth Kan\" <notifications@github.com> wrote:\n\n> Yes @kenhkan <https://github.com/kenhkan> that sounds to me exactly what\n> the problem was. I just couldn't see it! I'm embarrassed!\n>\n> Welcome to the JS world! :) It's not you at all. It's just extremely easy\n> to make mistakes and extremely hard to debug in JS. @ComFreek\n> <https://github.com/ComFreek> did a fantastic job finding the bug.\n>\n> @kenhkan <https://github.com/kenhkan> do your delay test cases work now?\n> I got the impression that they did already...? Slightly different\n> scheduling logic, maybe?\n>\n> Yes it does. It didn't initially for a different reason: because I hadn't\n> implemented loopers in ES5. All is good now.\n>\n> And yes, completely different scheduling logic.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jpaulm/jsfbp/issues/12#issuecomment-76541433>.\n>\n"}}