Skip to content

Instantly share code, notes, and snippets.

@Odomontois
Created April 5, 2018 15:48
Show Gist options
  • Save Odomontois/cb23d062bae84fd4a2f2cd783577e086 to your computer and use it in GitHub Desktop.
Save Odomontois/cb23d062bae84fd4a2f2cd783577e086 to your computer and use it in GitHub Desktop.
Source lazy concat
implicit class SourceLazyOps[E, M](val src: Source[E, M]) extends AnyVal {
def concatLazy[M1](src2: => Source[E, M1]): Source[E, NotUsed] =
Source(List(() => src, () => src2)).flatMapConcat(_ ())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment