{"action":"created","issue":{"url":"https://api.github.com/repos/square/retrofit/issues/2311","repository_url":"https://api.github.com/repos/square/retrofit","labels_url":"https://api.github.com/repos/square/retrofit/issues/2311/labels{/name}","comments_url":"https://api.github.com/repos/square/retrofit/issues/2311/comments","events_url":"https://api.github.com/repos/square/retrofit/issues/2311/events","html_url":"https://github.com/square/retrofit/issues/2311","id":226451300,"number":2311,"title":"Chunked streaming not behaving as expected","user":{"login":"arunshankar87","id":6120670,"avatar_url":"https://avatars1.githubusercontent.com/u/6120670?v=3","gravatar_id":"","url":"https://api.github.com/users/arunshankar87","html_url":"https://github.com/arunshankar87","followers_url":"https://api.github.com/users/arunshankar87/followers","following_url":"https://api.github.com/users/arunshankar87/following{/other_user}","gists_url":"https://api.github.com/users/arunshankar87/gists{/gist_id}","starred_url":"https://api.github.com/users/arunshankar87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunshankar87/subscriptions","organizations_url":"https://api.github.com/users/arunshankar87/orgs","repos_url":"https://api.github.com/users/arunshankar87/repos","events_url":"https://api.github.com/users/arunshankar87/events{/privacy}","received_events_url":"https://api.github.com/users/arunshankar87/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-05T01:28:54Z","updated_at":"2017-05-05T05:20:59Z","closed_at":"2017-05-05T05:20:59Z","body":"@GET(\"poll/session/{sessionId}/details\")\r\nObservable<ResponseBody> getSessionDetails(@Path(\"sessionId\") String sessionId);\r\n\r\n@GET(\"poll/session/{sessionId}/details\")\r\n@Streaming\r\nObservable<ResponseBody> getSessionDetails(@Path(\"sessionId\") String sessionId);\r\n\r\n@Override\r\n    public Observable<String> getSessionDetails(String sessionId) {\r\n        return sessionAPI.getSessionDetails(sessionId)\r\n                .flatMap(responseBody -> events(responseBody.source()));\r\n    }\r\n\r\n\r\n    public static Observable<String> events(BufferedSource source) {\r\n        return Observable.create(subscriber -> {\r\n            try {\r\n                while (!source.exhausted()) {\r\n                    subscriber.onNext(source.readUtf8Line());\r\n                }\r\n            } catch (IOException e) {\r\n                e.printStackTrace();\r\n                subscriber.onError(e);\r\n            }\r\n            subscriber.onCompleted();\r\n        });\r\n    }\r\n\r\nThe events() method does not get called unless all the chunks are done. \r\n\r\nBut the chunked streams are expected to be delivered chunk by chunk, which does not seem to be happening.\r\n\r\nI have tried with and without the @Streaming annotation to the API, yet the behaviour is same."},"comment":{"url":"https://api.github.com/repos/square/retrofit/issues/comments/299378566","html_url":"https://github.com/square/retrofit/issues/2311#issuecomment-299378566","issue_url":"https://api.github.com/repos/square/retrofit/issues/2311","id":299378566,"user":{"login":"arunshankar87","id":6120670,"avatar_url":"https://avatars1.githubusercontent.com/u/6120670?v=3","gravatar_id":"","url":"https://api.github.com/users/arunshankar87","html_url":"https://github.com/arunshankar87","followers_url":"https://api.github.com/users/arunshankar87/followers","following_url":"https://api.github.com/users/arunshankar87/following{/other_user}","gists_url":"https://api.github.com/users/arunshankar87/gists{/gist_id}","starred_url":"https://api.github.com/users/arunshankar87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunshankar87/subscriptions","organizations_url":"https://api.github.com/users/arunshankar87/orgs","repos_url":"https://api.github.com/users/arunshankar87/repos","events_url":"https://api.github.com/users/arunshankar87/events{/privacy}","received_events_url":"https://api.github.com/users/arunshankar87/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T05:20:59Z","updated_at":"2017-05-05T05:20:59Z","body":"http://stackoverflow.com/questions/43795147/chunked-streaming-not-behaving-as-expected-retrofitrxjava/43797047#43797047\r\n\r\nThis was the reason. "}}
{"actor":{"display_login":"arunshankar87"}}