Adds docs for actorRef stream integration #24595

This commit is contained in:
Nicolas Vollmar 2019-03-08 17:13:59 +01:00 committed by Johan Andrén
parent b8c99c5c8a
commit 44709e6bba
3 changed files with 45 additions and 0 deletions

View file

@ -499,4 +499,20 @@ class IntegrationDocSpec extends AkkaSpec(IntegrationDocSpec.config) {
//#source-queue
}
"illustrate use of source actor ref" in {
//#source-actorRef
val bufferSize = 10
val ref = Source
.actorRef[Int](bufferSize, OverflowStrategy.fail) // note: backpressure is not supported
.map(x x * x)
.toMat(Sink.foreach(x println(s"completed $x")))(Keep.left)
.run()
ref ! 1
ref ! 2
ref ! 3
ref ! akka.actor.Status.Success("done")
//#source-actorRef
}
}