Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@boekabart
Created April 16, 2015 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boekabart/b418c59392184324c7bd to your computer and use it in GitHub Desktop.
Save boekabart/b418c59392184324c7bd to your computer and use it in GitHub Desktop.
Akka.Net await Ask<> within Receive<> deadlocks?
private void Ready()
{
Receive<CanAcceptJob>(AsyncBehavior.Suspend, async job =>
{
_coordinator.Tell(job);
await BecomeAsking();
});
}
private async Task BecomeAsking()
{
_canAcceptJobSender = Sender;
var task = _coordinator.Ask<Routees>(new GetRoutees());
var routees = await task; // deadlocks here!
pendingJobReplies = routees.Members.Count();
Become(Asking);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment