Adds docs for actorRef stream integration #24595
This commit is contained in:
parent
b8c99c5c8a
commit
44709e6bba
3 changed files with 45 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue