akka-streams-example icon indicating copy to clipboard operation
akka-streams-example copied to clipboard

Implemented the RedditAPI to use akka-http

Open shkr opened this issue 9 years ago • 3 comments

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

shkr avatar Oct 17 '15 10:10 shkr

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]?

inanna-malick avatar Oct 18 '15 16:10 inanna-malick

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.

shkr avatar Oct 18 '15 18:10 shkr

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 ?

shkr avatar Oct 24 '15 03:10 shkr