Skip to content

Instantly share code, notes, and snippets.

@ktoso
Created July 3, 2015 11:19
Show Gist options
  • Save ktoso/ad3b74e695d84f74c08c to your computer and use it in GitHub Desktop.
Save ktoso/ad3b74e695d84f74c08c to your computer and use it in GitHub Desktop.
bidProjection.latestOffset.foreach { startFromOffset =>
readJournal
.query(EventsByTag("bid", startFromOffset))
.mapAsync(8) { envelope => (writer ? envelope.event).map(_ => envelope.offset) }
.mapAsync(1) { offset => bidProjection.saveProgress(offset) }
.runWith(Sink.ignore)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment