{"action":"created","issue":{"url":"https://api.github.com/repos/loopj/android-async-http/issues/781","labels_url":"https://api.github.com/repos/loopj/android-async-http/issues/781/labels{/name}","comments_url":"https://api.github.com/repos/loopj/android-async-http/issues/781/comments","events_url":"https://api.github.com/repos/loopj/android-async-http/issues/781/events","html_url":"https://github.com/loopj/android-async-http/issues/781","id":53856980,"number":781,"title":"Synchronous mode with AsyncHttpClient","user":{"login":"gsteigert","id":1030861,"avatar_url":"https://avatars.githubusercontent.com/u/1030861?v=3","gravatar_id":"","url":"https://api.github.com/users/gsteigert","html_url":"https://github.com/gsteigert","followers_url":"https://api.github.com/users/gsteigert/followers","following_url":"https://api.github.com/users/gsteigert/following{/other_user}","gists_url":"https://api.github.com/users/gsteigert/gists{/gist_id}","starred_url":"https://api.github.com/users/gsteigert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsteigert/subscriptions","organizations_url":"https://api.github.com/users/gsteigert/orgs","repos_url":"https://api.github.com/users/gsteigert/repos","events_url":"https://api.github.com/users/gsteigert/events{/privacy}","received_events_url":"https://api.github.com/users/gsteigert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/loopj/android-async-http/labels/question","name":"question","color":"c7def8"}],"state":"closed","locked":false,"assignee":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/loopj/android-async-http/milestones/7","html_url":"https://github.com/loopj/android-async-http/milestones/1.4.8","labels_url":"https://api.github.com/repos/loopj/android-async-http/milestones/7/labels","id":1051698,"number":7,"title":"1.4.8","description":null,"creator":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":45,"state":"open","created_at":"2015-04-03T11:30:28Z","updated_at":"2015-07-12T15:12:20Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-01-09T11:06:24Z","updated_at":"2015-07-12T15:12:20Z","closed_at":"2015-07-12T15:12:20Z","body":"Is there a way to handle responses synchronously with AsyncHttpClient? My handler is created within the main thread, which has a message looper as required, but it still cannot be used with AsyncHttpClient in synchronous mode.\r\n\r\nIf the only way is to use the SyncHttpClient, then I don't understand why there is a \"setUseSynchronousMode\" method in AsyncHttpResponseHandler - the response handling strategy could simply be infered by the client instance being used.\r\n\r\nWhat I'd really like is to always use AsyncHttpClient and take advantage of the handler's \"SynchronousMode\" flag to configure on which thread the response handling will occur.\r\n\r\nDoes that make any sense?"},"comment":{"url":"https://api.github.com/repos/loopj/android-async-http/issues/comments/120728573","html_url":"https://github.com/loopj/android-async-http/issues/781#issuecomment-120728573","issue_url":"https://api.github.com/repos/loopj/android-async-http/issues/781","id":120728573,"user":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T15:12:20Z","updated_at":"2015-07-12T15:12:20Z","body":"`setUseSynchronousMode` purpose is to allow single implementation of AsyncHttpResponseHandler for both sync and async use-cases, you can see that in usages of the method\r\n\r\nThis is already handled on per-request basis, so if you provide ResponseHandler instance with `useSynchronousMode` set to `true` to `AsyncHttpClient`, it will be handled synchronously, `SyncHttpClient` is just simplification of the process."}}