You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Although i completely accept the concept of blocking code to get the results needed.
Is there any particular reason that you are using
// GithubCommanderActor's BecomeAsking method - replace it with this
private void BecomeAsking()
{
_canAcceptJobSender = Sender;
// block, but ask the router for the number of routees. Avoids magic numbers.
pendingJobReplies = _coordinator.Ask<Routees>(new GetRoutees())
.Result.Members.Count(); // Usage of .Result
Become(Asking);
}
Instead of using .GetAwaiter().GetResult() which is the preferred way to avoid possible deadlocks and miss behaviors ?
// GithubCommanderActor's BecomeAsking method - replace it with this
private void BecomeAsking()
{
_canAcceptJobSender = Sender;
// block, but ask the router for the number of routees. Avoids magic numbers.
pendingJobReplies = _coordinator.Ask<Routees>(new GetRoutees())
.GetAwaiter()
.GetResult()
.Members.Count();
Become(Asking);
}
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
Although i completely accept the concept of blocking code to get the results needed.
Is there any particular reason that you are using
Instead of using
.GetAwaiter().GetResult()
which is the preferred way to avoid possible deadlocks and miss behaviors ?Thanks.
The text was updated successfully, but these errors were encountered: