akka/akka-core

Add notes about shutdown patterns for Streams to docs

Offen

#22.183 geöffnet am 23.01.2017

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (3.547 Forks)batch import
1 - triagedhelp wantedt:docs

Repository-Metriken

Stars
 (13.277 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8T 19h) (10 gemergte PRs in 30 T)

Beschreibung

As a newbie, I ran into a case where I couldn't understand how to terminate the ActorSystem, used to materialize the Stream, after the latter has finished it work. I scanned through the titles in the doc and couldn't find a word about shutdown patterns. The onComplete() callback (which was an obvious choice) unexpectedly fired right after my pipeline was run. Thanks to akka gitter chat and @ktoso, I was pointed towards "Custom materialized values" section, because it turned out I didn't use one in my custom Sink, and that's why onComplete() fired too early. But it was very unobvious to me as a beginner.

So it'd be great if there will be some small section in the beginning of the Streams doc, that has a keyword "shutdown" or similar and explains basic necessity of Mat values for signaling completition of a stream with an example of a proper shutdown pattern.

Contributor Guide