{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11669","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11669/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11669/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11669/events","html_url":"https://github.com/JuliaLang/julia/pull/11669","id":87396891,"number":11669,"title":"RFC: clean up timer API","user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-11T16:06:49Z","updated_at":"2015-06-11T16:14:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11669","html_url":"https://github.com/JuliaLang/julia/pull/11669","diff_url":"https://github.com/JuliaLang/julia/pull/11669.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11669.patch"},"body":"This fixes the following problems:\r\n\r\n* start_timer and stop_timer were ugly, and are now removed.\r\n* Timer resources were never fully freed because Timers were never closed, only \"stopped\". It wasn't clear whether a stopped timer was done for good, or would be restarted.\r\n* We were calling user callbacks directly from libuv callbacks, meaning they could not block.\r\n\r\nThe new API is\r\n\r\n* `Timer(callback, timeout, repeat=0)` creates *and starts* a timer that calls a callback repeatedly.\r\n* `close(timer)` stops and fully shuts down a timer. If a timer is set not to repeat, it closes itself after firing once.\r\n* `Timer(timeout, repeat=0)` creates a timer that periodically wakes up whoever calls `wait` on it. This is used to implement `sleep` in 1 line.\r\n\r\nThis PR also removes `SingleAsyncWork` because it's not used anywhere and is redundant with `@schedule`.\r\n\r\nDeveloped with @vtjnash."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/111189296","html_url":"https://github.com/JuliaLang/julia/pull/11669#issuecomment-111189296","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11669","id":111189296,"user":{"login":"Keno","id":1291671,"avatar_url":"https://avatars.githubusercontent.com/u/1291671?v=3","gravatar_id":"","url":"https://api.github.com/users/Keno","html_url":"https://github.com/Keno","followers_url":"https://api.github.com/users/Keno/followers","following_url":"https://api.github.com/users/Keno/following{/other_user}","gists_url":"https://api.github.com/users/Keno/gists{/gist_id}","starred_url":"https://api.github.com/users/Keno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keno/subscriptions","organizations_url":"https://api.github.com/users/Keno/orgs","repos_url":"https://api.github.com/users/Keno/repos","events_url":"https://api.github.com/users/Keno/events{/privacy}","received_events_url":"https://api.github.com/users/Keno/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T16:14:09Z","updated_at":"2015-06-11T16:14:09Z","body":"SingleAsyncWork is used in packages for cross-thread communication."}}