From 34d51dcd001a3917bda3272751195e9f0e863b02 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 15 Apr 2016 16:29:53 +0200 Subject: [PATCH] Clarify explanation of Source.actorRef termination in embedded doc Make it clear that a Success instance (whose payload will be ignored) must be sent to complete the source, and not the Success companion object itself. Use "a" before instances, and remove "a" before PoisonPill object. The Java documentation has been aligned to the Scala documentation. --- .../src/main/scala/akka/stream/javadsl/Source.scala | 11 +++++++---- .../src/main/scala/akka/stream/scaladsl/Source.scala | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala b/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala index 4da17ced0e..2adf8b06ac 100644 --- a/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala @@ -238,11 +238,14 @@ object Source { * if there is no demand from downstream. When `bufferSize` is 0 the `overflowStrategy` does * not matter. * - * The stream can be completed successfully by sending [[akka.actor.PoisonPill]] or - * [[akka.actor.Status.Success]] to the actor reference. + * The stream can be completed successfully by sending the actor reference a [[akka.actor.Status.Success]] + * (whose content will be ignored) in which case already buffered elements will be signaled before signaling + * completion, or by sending [[akka.actor.PoisonPill]] in which case completion will be signaled immediately. * - * The stream can be completed with failure by sending [[akka.actor.Status.Failure]] to the - * actor reference. + * The stream can be completed with failure by sending a [[akka.actor.Status.Failure]] to the + * actor reference. In case the Actor is still draining its internal buffer (after having received + * a [[akka.actor.Status.Success]]) before signaling completion and it receives a [[akka.actor.Status.Failure]], + * the failure will be signaled downstream immediately (instead of the completion signal). * * The actor will be stopped when the stream is completed, failed or canceled from downstream, * i.e. you can watch it to get notified when that happens. diff --git a/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala b/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala index 9021d4d9a5..9348a9f7fc 100644 --- a/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala @@ -373,13 +373,13 @@ object Source { * if there is no demand from downstream. When `bufferSize` is 0 the `overflowStrategy` does * not matter. * - * The stream can be completed successfully by sending the actor reference an [[akka.actor.Status.Success]] - * message in which case already buffered elements will be signaled before signaling completion, - * or by sending a [[akka.actor.PoisonPill]] in which case completion will be signaled immediately. + * The stream can be completed successfully by sending the actor reference a [[akka.actor.Status.Success]] + * (whose content will be ignored) in which case already buffered elements will be signaled before signaling + * completion, or by sending [[akka.actor.PoisonPill]] in which case completion will be signaled immediately. * - * The stream can be completed with failure by sending [[akka.actor.Status.Failure]] to the + * The stream can be completed with failure by sending a [[akka.actor.Status.Failure]] to the * actor reference. In case the Actor is still draining its internal buffer (after having received - * an [[akka.actor.Status.Success]]) before signaling completion and it receives a [[akka.actor.Status.Failure]], + * a [[akka.actor.Status.Success]]) before signaling completion and it receives a [[akka.actor.Status.Failure]], * the failure will be signaled downstream immediately (instead of the completion signal). * * The actor will be stopped when the stream is completed, failed or canceled from downstream,