akka-streams-example
akka-streams-example copied to clipboard
Implemented the RedditAPI to use akka-http
I implemented the RedditAPI calls using akka-http If it is useful I can submit a pull request, otherwise just posting here for reference
https://github.com/shkr/streams/blob/master/src/main/scala/org/shkr/akka/stream/wordcount/RedditAPI.scala in https://github.com/shkr/streams
That's really cool, thanks! You should absolutely file a PR.
Looking at the Akka HTTP API, it seems to include a few different Flow[(T, HttpRequest), (T, HttpResponse), _]
's that execute a stream of HTTP requests. I wonder if it would be possible to use those instead of issuing single HTTP requests and mapping over the resulting Future[HttpResponse]
?
Good call! That will allow better composition of the the HTTP Request and closely resemble the word count graph processing flow. will submit a PR with that change.
Updated https://github.com/shkr/streams by using akka http host level api rather than making multiple SingleRequests. Each of the calls, topSubreddits, topLinks and topComments have this been implemented as flows, instead of methods which resembled single http request to response parsing calls. https://github.com/shkr/streams/blob/master/src/main/scala/org/shkr/akka/stream/wordcount/RedditFlow.scala. Thoughts ?