{"action":"created","issue":{"url":"https://api.github.com/repos/cedexis/RadarKit/issues/4","labels_url":"https://api.github.com/repos/cedexis/RadarKit/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/cedexis/RadarKit/issues/4/comments","events_url":"https://api.github.com/repos/cedexis/RadarKit/issues/4/events","html_url":"https://github.com/cedexis/RadarKit/issues/4","id":76055956,"number":4,"title":"Don't use synchronous requests","user":{"login":"brianmichel","id":63919,"avatar_url":"https://avatars.githubusercontent.com/u/63919?v=3","gravatar_id":"","url":"https://api.github.com/users/brianmichel","html_url":"https://github.com/brianmichel","followers_url":"https://api.github.com/users/brianmichel/followers","following_url":"https://api.github.com/users/brianmichel/following{/other_user}","gists_url":"https://api.github.com/users/brianmichel/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmichel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmichel/subscriptions","organizations_url":"https://api.github.com/users/brianmichel/orgs","repos_url":"https://api.github.com/users/brianmichel/repos","events_url":"https://api.github.com/users/brianmichel/events{/privacy}","received_events_url":"https://api.github.com/users/brianmichel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-13T17:04:43Z","updated_at":"2015-07-31T20:09:17Z","closed_at":null,"body":"I've noticed in the `RadarKit` library, the common pattern is to do something like this...\r\n\r\n```objc\r\n    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\r\n        [[[Radar alloc] init]\r\n            runForZoneId:1\r\n           AndCustomerId:10660\r\n             //AndProtocol:@\"https\"\r\n        ];\r\n    });\r\n```\r\nFrom my reading, it seems like this is bacause `+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error` is used internally to the library to perform network requests.\r\n\r\nFrom the calling interface, i.e. `[[[Radar alloc] init] ...]` there is no return value, and not asynchronous callback to pass in, so it's a bit of a smell to run this in it's own dispatch block.\r\n\r\nWould it be possible to move to using `+ (void)sendAsynchronousRequest:(NSURLRequest *)request queue:(NSOperationQueue *)queue completionHandler:(void (^)(NSURLResponse *response, NSData *data, NSError *connectionError))handler` internally? This would allow the caller to not dispatch into a background block while calling into your library."},"comment":{"url":"https://api.github.com/repos/cedexis/RadarKit/issues/comments/126801736","html_url":"https://github.com/cedexis/RadarKit/issues/4#issuecomment-126801736","issue_url":"https://api.github.com/repos/cedexis/RadarKit/issues/4","id":126801736,"user":{"login":"javorosas","id":2592262,"avatar_url":"https://avatars.githubusercontent.com/u/2592262?v=3","gravatar_id":"","url":"https://api.github.com/users/javorosas","html_url":"https://github.com/javorosas","followers_url":"https://api.github.com/users/javorosas/followers","following_url":"https://api.github.com/users/javorosas/following{/other_user}","gists_url":"https://api.github.com/users/javorosas/gists{/gist_id}","starred_url":"https://api.github.com/users/javorosas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javorosas/subscriptions","organizations_url":"https://api.github.com/users/javorosas/orgs","repos_url":"https://api.github.com/users/javorosas/repos","events_url":"https://api.github.com/users/javorosas/events{/privacy}","received_events_url":"https://api.github.com/users/javorosas/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T20:09:17Z","updated_at":"2015-07-31T20:09:17Z","body":"Resolved in 20602f55a115ee7f3bce59de7f369e22f70805eb"}}