Created
April 16, 2015 21:42
-
-
Save boekabart/b418c59392184324c7bd to your computer and use it in GitHub Desktop.
Akka.Net await Ask<> within Receive<> deadlocks?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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