{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-http/issues/63","repository_url":"https://api.github.com/repos/akka/akka-http","labels_url":"https://api.github.com/repos/akka/akka-http/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/63/comments","events_url":"https://api.github.com/repos/akka/akka-http/issues/63/events","html_url":"https://github.com/akka/akka-http/issues/63","id":175789133,"number":63,"title":"Provide an example for how to implement Http long polling","user":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akka/akka-http/labels/3%20-%20in%20progress","name":"3 - in progress","color":"eb6420"},{"url":"https://api.github.com/repos/akka/akka-http/labels/community","name":"community","color":"128A0C"},{"url":"https://api.github.com/repos/akka/akka-http/labels/t:http","name":"t:http","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/akka/akka-http/milestones/4","html_url":"https://github.com/akka/akka-http/milestones/2.4.x","labels_url":"https://api.github.com/repos/akka/akka-http/milestones/4/labels","id":1990897,"number":4,"title":"2.4.x","description":"","creator":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":3,"state":"open","created_at":"2016-09-08T11:08:53Z","updated_at":"2016-09-08T15:44:06Z","due_on":null,"closed_at":null},"comments":21,"created_at":"2016-09-08T15:44:06Z","updated_at":"2016-09-08T15:44:33Z","closed_at":null,"body":"<a href=\"https://github.com/agemooij\"><img src=\"https://avatars.githubusercontent.com/u/46568?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [agemooij](https://github.com/agemooij)**\n_Tuesday Mar 22, 2016 at 16:33 GMT_\n_Originally opened as https://github.com/akka/akka/issues/20121_\n\n----\n\nQuoted from a Gitter discussion:\r\n\r\n>Hey hakkers. I'm still pretty new to doing complex things with streams and akka-http. Does anyone have an example of how to implement long polling with the client-side part of akka-http? I've got a Consul client written as Spray actors that I'm thinking of moving to akka-http but the conceptual model is (unsurprisingly) very different indeed.\r\n\r\n>The docs mention long polling a bunch of times when discussing the higher (i.e. connection pooling) API levels but I can't find any real information (docs, examples, blogs, SO questions, etc.) on how I would go about implementing a long polling client using akka-http and streams.\r\n\r\n>For instance: I want to poll forever but how do I automatically recreate the http connection produced by Http().outgoingConnection when it closes? And that method produces a Flow[HttpRequest, HttpResponse, Future[Http.OutgoingConnection]] but how do I turn that into a loop of requests where every next request is based on the response to the previous one (i.e. polling forchanges since the index that got sent with the previous change). Both of these are basically circular/recursive internal graph stages but conceptually what I want is a Source[ConsulChangeEvent].\r\n\n"},"comment":{"url":"https://api.github.com/repos/akka/akka-http/issues/comments/245641367","html_url":"https://github.com/akka/akka-http/issues/63#issuecomment-245641367","issue_url":"https://api.github.com/repos/akka/akka-http/issues/63","id":245641367,"user":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T15:44:33Z","updated_at":"2016-09-08T15:44:33Z","body":"<a href=\"https://github.com/ktoso\"><img src=\"https://avatars.githubusercontent.com/u/120979?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [ktoso](https://github.com/ktoso)**\n_Friday Apr 22, 2016 at 23:49 GMT_\n\n----\n\nSo I've read through but need to give it a spin to notice exact semantics, some things that are missing you pointed out. API style actually is something we could provide - exacly such extension.\r\n\r\nI also noted:\r\n`                        nextRequest: HttpResponse ⇒ HttpRequest, // yeah, this makes a lot of sense, possibly a default could be identity (imagine stateful endpoint, like twitter stream)`\r\n\r\n`      import s._ // avoid importing everything from system`\r\n\r\n`          .collect { case Success(response) ⇒ response } // probably log failures though?`\r\n\r\n`          .mapAsync(1)(response ⇒ response.entity.toStrict(5.seconds).map(strictEntity ⇒ response.copy(entity = strictEntity))) // we'd likely want to the toStrict and combine with \"json streaming\" (once i finally finish it)?`\r\n\r\n`          .withAttributes(ActorAttributes.supervisionStrategy(Supervision.resumingDecider)) // TODO: turn into log-and-resume` supervision in its current form is not that good, not sure if this is very needed here, if possible working without it would be preferable\r\n\r\nthe materialized value to control it is obviously a key feature to add.\r\n\r\nsingle-connection host pool likely makes sense for this scenario, I think agree, this way we don't impact anyone else; but will try to verify with others.\r\n\r\nWe'll meet with the team on monday and I hope to have a look together at this and how it could move forward btw.\r\n\r\nHope the comments some sense and we'll be back here soon :)\n"}}
{"actor":{"display_login":"akka-ci"}}