Accor message Akka with continuation

I have an actor who takes a result from another actor and applies some validation to it.

class Actor1(actor2:Actor2) {

  def receive = {
    case SomeMessage =>
      val r = actor2 ? NewMessage()
      r.map(someTransform).pipeTo(sender)
  }
}

Now, if I make a request from Actor1, we now have 2 futures that do not seem too efficient. Is there a way to provide some kind of continuation or some other approach that I could use here?

    case SomeMessage => actor2.forward(NewMessage, someTransform)
+4
source share
1 answer

ExecutionContext, . , , . - , , , , , , . , .

, akka . , , , , , . , , . , , , , .

, , sometransform . - .

+3

All Articles