{"action":"created","issue":{"url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/23","repository_url":"https://api.github.com/repos/haxeui/haxeui-kha","labels_url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/23/comments","events_url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/23/events","html_url":"https://github.com/haxeui/haxeui-kha/pull/23","id":304288303,"number":23,"title":"Timer fix","user":{"login":"aW4KeNiNG","id":1063719,"avatar_url":"https://avatars0.githubusercontent.com/u/1063719?v=4","gravatar_id":"","url":"https://api.github.com/users/aW4KeNiNG","html_url":"https://github.com/aW4KeNiNG","followers_url":"https://api.github.com/users/aW4KeNiNG/followers","following_url":"https://api.github.com/users/aW4KeNiNG/following{/other_user}","gists_url":"https://api.github.com/users/aW4KeNiNG/gists{/gist_id}","starred_url":"https://api.github.com/users/aW4KeNiNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aW4KeNiNG/subscriptions","organizations_url":"https://api.github.com/users/aW4KeNiNG/orgs","repos_url":"https://api.github.com/users/aW4KeNiNG/repos","events_url":"https://api.github.com/users/aW4KeNiNG/events{/privacy}","received_events_url":"https://api.github.com/users/aW4KeNiNG/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-12T09:07:09Z","updated_at":"2018-03-12T09:42:17Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/haxeui/haxeui-kha/pulls/23","html_url":"https://github.com/haxeui/haxeui-kha/pull/23","diff_url":"https://github.com/haxeui/haxeui-kha/pull/23.diff","patch_url":"https://github.com/haxeui/haxeui-kha/pull/23.patch"},"body":"Related to #21 , but this PR is a better solution I think.\r\n\r\n* The TimerBase has problems. If you calls the stop method while the callback is in execution, the TimeTask isn't deleted and it continues executing forever (because Kha removes the activeTimer while it is executing, and add it again to the queue if the callback function in `addBreakableTimeTaskToGroup` returns `true`);\r\n\r\n* CallLaterBase and `addFrameTask` doesn't work like that. The second parameter is `priority`, not `delay`. And it returns a `taskid`, that it should be removed when the callback is executed. But it has the same problem that I have described in the first point.\r\n\r\n* If you calls `callLater` from another callLater's callback, then Kha is executing the `kha.Scheduler.executeTimeTasks` method in infinite loop, because it executes the tasks while the length > 0 ( `while(kha_Scheduler.timeTasks.length > 0)`). So, it doesn't finish never. We need a real `haxe.Timer.delay` call at least.\r\n"},"comment":{"url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/comments/372248476","html_url":"https://github.com/haxeui/haxeui-kha/pull/23#issuecomment-372248476","issue_url":"https://api.github.com/repos/haxeui/haxeui-kha/issues/23","id":372248476,"user":{"login":"sh-dave","id":13007175,"avatar_url":"https://avatars3.githubusercontent.com/u/13007175?v=4","gravatar_id":"","url":"https://api.github.com/users/sh-dave","html_url":"https://github.com/sh-dave","followers_url":"https://api.github.com/users/sh-dave/followers","following_url":"https://api.github.com/users/sh-dave/following{/other_user}","gists_url":"https://api.github.com/users/sh-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/sh-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sh-dave/subscriptions","organizations_url":"https://api.github.com/users/sh-dave/orgs","repos_url":"https://api.github.com/users/sh-dave/repos","events_url":"https://api.github.com/users/sh-dave/events{/privacy}","received_events_url":"https://api.github.com/users/sh-dave/received_events","type":"User","site_admin":false},"created_at":"2018-03-12T09:42:17Z","updated_at":"2018-03-12T09:42:17Z","author_association":"CONTRIBUTOR","body":"Only `addFrameTask` runs forever, `addTimeTask` will stop after X runs if the 3. `period` parameter is 0 and only run once if the 4. `duration` parameter is also 0. This is what my PR did."}}
{"actor":{"display_login":"sh-dave"}}