Skip to content
Search

Akka:Stream:Keep

lastmod 2020-09-24created 2020-09-241 edits

Keep in akka-stream

About

Every stream processing stage can produce a materialized value, which can be captured using viaMat or toMat (as opposed to via() or to(), respectively). In your code snippet, using source.toMat(sink) indicates that you're interested in capturing the materialized values of the source and the sink, and

  • Keep.right keeps the right side (i.e., the sink) of the materialized value.
  • Keep.left keeps the materialized value on the left (i.e., the source), and
  • Keep.both lets you keep both.

See also

author Zer0 sitemap