Docs: Actor source stream operators (#29178)
This commit is contained in:
parent
2c4e114ecd
commit
bc68f0d650
12 changed files with 288 additions and 29 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue