Last active
July 20, 2018 11:39
-
-
Save ticofab/24656255f44251eae4446667061a4f85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source | |
// emits a GiveToken object once a day | |
.tick(0.seconds, 1.day, GiveToken) | |
// asks the Token Actor the auth token, is received as a string | |
.mapAsync(1)(msg => (tokenActor ? msg) (3.seconds).mapTo[String]) | |
// passes it to the event request flow, implmented separately | |
.via(eventRequestFlow) | |
// unmarshal the results and maps it to my internal CoinEvent object | |
.map(eventListUnmarshaller) | |
.map(_.flatMap(EventAPI.toCoinEvents))) | |
// publishes the result on Google Pub/Sub, implemented separately with Alpakka | |
.via(eventPubSubFlow) | |
// forwards the event list to the Coin Actor | |
.runForeach(ev => coinActor ! ev) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment