{"action":"closed","issue":{"url":"https://api.github.com/repos/Quick/Nimble/issues/346","repository_url":"https://api.github.com/repos/Quick/Nimble","labels_url":"https://api.github.com/repos/Quick/Nimble/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/Quick/Nimble/issues/346/comments","events_url":"https://api.github.com/repos/Quick/Nimble/issues/346/events","html_url":"https://github.com/Quick/Nimble/issues/346","id":179576384,"number":346,"title":"toEventually blocks the main thread","user":{"login":"Blackjacx","id":794372,"avatar_url":"https://avatars.githubusercontent.com/u/794372?v=3","gravatar_id":"","url":"https://api.github.com/users/Blackjacx","html_url":"https://github.com/Blackjacx","followers_url":"https://api.github.com/users/Blackjacx/followers","following_url":"https://api.github.com/users/Blackjacx/following{/other_user}","gists_url":"https://api.github.com/users/Blackjacx/gists{/gist_id}","starred_url":"https://api.github.com/users/Blackjacx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blackjacx/subscriptions","organizations_url":"https://api.github.com/users/Blackjacx/orgs","repos_url":"https://api.github.com/users/Blackjacx/repos","events_url":"https://api.github.com/users/Blackjacx/events{/privacy}","received_events_url":"https://api.github.com/users/Blackjacx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Quick/Nimble/labels/question%20/%20needs%20more%20details","name":"question / needs more details","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-27T18:34:54Z","updated_at":"2016-10-04T04:04:54Z","closed_at":"2016-10-04T04:04:54Z","body":"I found an issue that I need to solve. Consider the following code snippet:\r\n\r\n    if !isExecuted {\r\n      isExecuted = true\r\n      let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(0.5 * Double(NSEC_PER_SEC)))\r\n      dispatch_after(delayTime, dispatch_get_main_queue()) {\r\n        self.centerMapOnUserLocation()\r\n      }\r\n    }\r\n\r\nI want to center the map on the users location using a delay or I want to simply dispatch something else on the main thread using Grand Central Dispatch. \r\n\r\nNow when I test that piece of asynchronous code using toEventually the dispatched task is blocked by the toEventually on the main thread which causes test pollution I think. See the following example:\r\n\r\nrun my piece of code ----o----- dispatches a task on the main thread after toEventually() (task2)\r\nrun toEventually ---------o----- polling regularly on mainThread (task1)\r\n\r\nSo it comes that task2 blocks task1 and produces a deadlock. Am I doing something wrong?"}}
{"actor":{"display_login":"jeffh"}}