* Deprecates status message based api #27503 * Deprecates actorRefWithAck for actorRefWithBackpressure
This commit is contained in:
parent
aee0152da2
commit
751918e84c
34 changed files with 618 additions and 195 deletions
|
|
@ -50,8 +50,8 @@ object SourceOperators {
|
|||
//#actorRef
|
||||
}
|
||||
|
||||
def actorRefWithAck(): Unit = {
|
||||
//#actorRefWithAck
|
||||
def actorRefWithBackpressure(): Unit = {
|
||||
//#actorRefWithBackpressure
|
||||
|
||||
import akka.actor.Status.Success
|
||||
import akka.actor.ActorRef
|
||||
|
|
@ -61,7 +61,9 @@ object SourceOperators {
|
|||
implicit val system: ActorSystem = ActorSystem()
|
||||
val probe = TestProbe()
|
||||
|
||||
val source: Source[Any, ActorRef] = Source.actorRefWithAck[Any]("ack")
|
||||
val source: Source[Any, ActorRef] = Source.actorRefWithBackpressure[Any]("ack", {
|
||||
case _: Success => CompletionStrategy.immediately
|
||||
}, PartialFunction.empty)
|
||||
val actorRef: ActorRef = source.to(Sink.foreach(println)).run()
|
||||
|
||||
probe.send(actorRef, "hello")
|
||||
|
|
@ -70,7 +72,7 @@ object SourceOperators {
|
|||
probe.expectMsg("ack")
|
||||
|
||||
// The stream completes successfully with the following message
|
||||
actorRef ! Success(CompletionStrategy.immediately)
|
||||
//#actorRefWithAck
|
||||
actorRef ! Success(())
|
||||
//#actorRefWithBackpressure
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue