From b3806cdbfa566ee0582718c83f95f4f018703eac Mon Sep 17 00:00:00 2001 From: Tim Harper Date: Sun, 1 May 2016 19:58:49 -0600 Subject: [PATCH] =doc add important async caveat for Source.actorRef --- .../src/main/scala/akka/stream/javadsl/Source.scala | 8 +++++--- .../src/main/scala/akka/stream/scaladsl/Source.scala | 8 +++++--- 2 files changed, 10 insertions(+), 6 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 bfcee5976a..54c94b8215 100644 --- a/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala @@ -248,9 +248,9 @@ object Source { * The strategy [[akka.stream.OverflowStrategy.backpressure]] is not supported, and an * IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument. * - * The buffer can be disabled by using `bufferSize` of 0 and then received messages are dropped - * if there is no demand from downstream. When `bufferSize` is 0 the `overflowStrategy` does - * not matter. + * The buffer can be disabled by using `bufferSize` of 0 and then received messages are dropped if there is no demand + * from downstream. When `bufferSize` is 0 the `overflowStrategy` does not matter. An async boundary is added after + * this Source; as such, it is never safe to assume the downstream will always generate demand. * * 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 @@ -264,6 +264,8 @@ object Source { * 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. * + * See also [[akka.stream.javadsl.Source.queue]]. + * * @param bufferSize The size of the buffer in element count * @param overflowStrategy Strategy that is used when incoming elements cannot fit inside the buffer */ 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 5fb765495e..5d2c4b8c14 100644 --- a/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala +++ b/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala @@ -380,9 +380,9 @@ object Source { * The strategy [[akka.stream.OverflowStrategy.backpressure]] is not supported, and an * IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument. * - * The buffer can be disabled by using `bufferSize` of 0 and then received messages are dropped - * if there is no demand from downstream. When `bufferSize` is 0 the `overflowStrategy` does - * not matter. + * The buffer can be disabled by using `bufferSize` of 0 and then received messages are dropped if there is no demand + * from downstream. When `bufferSize` is 0 the `overflowStrategy` does not matter. An async boundary is added after + * this Source; as such, it is never safe to assume the downstream will always generate demand. * * 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 @@ -396,6 +396,8 @@ object Source { * 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. * + * See also [[akka.stream.javadsl.Source.queue]]. + * * @param bufferSize The size of the buffer in element count * @param overflowStrategy Strategy that is used when incoming elements cannot fit inside the buffer */