Im new to akka.net and i have learned that in order to use the async and await pattern you would have to use the Ask() Method but as far as im understanding it , you can only await a task only if you fire a method within that actor or some object method, but is it possible to await a task that sends a message to another actor ?
let me illustrate by a simple example :
lets say ActorA received an Message and he needs some informations from ActorB, ActorA code would like this :
class ActorA :ReceiveActor
{
public ActorA ()
{
Receive<string>(Message => ActorB.Ask<string>());
}
}
lets say i want to stall waiting for a reply from actor B. i dont want to process any other messages. ActorB listens for the request, process the message and then finnally replies.
the thing is when ActorB replies it must reply of the form ActorA.tell(replymessage), and this way ActorA might never get to process the reply because the replyMessage should go to ActorA mailbox.
Am i missing something !