{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/20121","repository_url":"https://api.github.com/repos/akka/akka","labels_url":"https://api.github.com/repos/akka/akka/issues/20121/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/20121/comments","events_url":"https://api.github.com/repos/akka/akka/issues/20121/events","html_url":"https://github.com/akka/akka/issues/20121","id":142704636,"number":20121,"title":"Provide an example for how to implement Http long polling","user":{"login":"agemooij","id":46568,"avatar_url":"https://avatars.githubusercontent.com/u/46568?v=3","gravatar_id":"","url":"https://api.github.com/users/agemooij","html_url":"https://github.com/agemooij","followers_url":"https://api.github.com/users/agemooij/followers","following_url":"https://api.github.com/users/agemooij/following{/other_user}","gists_url":"https://api.github.com/users/agemooij/gists{/gist_id}","starred_url":"https://api.github.com/users/agemooij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agemooij/subscriptions","organizations_url":"https://api.github.com/users/agemooij/orgs","repos_url":"https://api.github.com/users/agemooij/repos","events_url":"https://api.github.com/users/agemooij/events{/privacy}","received_events_url":"https://api.github.com/users/agemooij/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-03-22T16:33:58Z","updated_at":"2016-04-03T20:19:49Z","closed_at":null,"body":"Quoted 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"},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/205047448","html_url":"https://github.com/akka/akka/issues/20121#issuecomment-205047448","issue_url":"https://api.github.com/repos/akka/akka/issues/20121","id":205047448,"user":{"login":"agemooij","id":46568,"avatar_url":"https://avatars.githubusercontent.com/u/46568?v=3","gravatar_id":"","url":"https://api.github.com/users/agemooij","html_url":"https://github.com/agemooij","followers_url":"https://api.github.com/users/agemooij/followers","following_url":"https://api.github.com/users/agemooij/following{/other_user}","gists_url":"https://api.github.com/users/agemooij/gists{/gist_id}","starred_url":"https://api.github.com/users/agemooij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agemooij/subscriptions","organizations_url":"https://api.github.com/users/agemooij/orgs","repos_url":"https://api.github.com/users/agemooij/repos","events_url":"https://api.github.com/users/agemooij/events{/privacy}","received_events_url":"https://api.github.com/users/agemooij/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T20:19:49Z","updated_at":"2016-04-03T20:19:49Z","body":"I hope my efforts at slowly clawing my way towards enlightenment provide some insight into the struggles of people trying to figure out how this stream stuff works :smile: "}}