Docs: Actor source stream operators (#29178)

This commit is contained in:
Enno 2020-06-15 14:11:28 +02:00 committed by GitHub
parent 2c4e114ecd
commit bc68f0d650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 288 additions and 29 deletions

View file

@ -67,9 +67,14 @@ object SourceOperators {
val probe = TestProbe()
val source: Source[Any, ActorRef] = Source.actorRefWithBackpressure[Any]("ack", {
case _: Success => CompletionStrategy.immediately
}, PartialFunction.empty)
val source: Source[String, ActorRef] = Source.actorRefWithBackpressure[String](
ackMessage = "ack",
// complete when we send akka.actor.status.Success
completionMatcher = {
case _: Success => CompletionStrategy.immediately
},
// do not fail on any message
failureMatcher = PartialFunction.empty)
val actorRef: ActorRef = source.to(Sink.foreach(println)).run()
probe.send(actorRef, "hello")