Skip to content

Commit

Permalink
use Failure to programmatically cancel Ask (#5187)
Browse files Browse the repository at this point in the history
* close #3019 - use `Failure` to programmatically cancel `Ask`

* added `SendSystemMessage` call back
  • Loading branch information
Aaronontheweb committed Aug 10, 2021
1 parent 0673dc3 commit 6b4a913
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/Akka/Actor/ActorRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ protected override void TellInternal(object message, IActorRef sender)
{
_result.TrySetResult(t);
}
else if (message is Failure f)
{
_result.TrySetException(f.Exception ?? new TaskCanceledException("Task cancelled by actor via Failure message."));
}
else
{
_result.TrySetException(new ArgumentException(
Expand All @@ -142,7 +146,7 @@ protected override void TellInternal(object message, IActorRef sender)
}
}
}

/// <summary>
/// TBD
/// </summary>
Expand Down

0 comments on commit 6b4a913

Please sign in to comment.