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
* removed confusing and conflicting examples in the `ReceiveActor` documentation
* Embedded reference to "how actors restart" YouTube video in supervision docs
Another good practice is to declare local messages (messages that are sent in process) within the Actor, which makes it easier to know what messages are generally being sent over the wire vs in process.:
Itcanhappenthatwhileamessageisbeingprocessedbyanactor, thatsomekindofexceptionisthrown, e.g. adatabaseexception.
806
+
## Actors and Exceptions
807
+
Anexceptioncanbethrownwhileamessageisbeingprocessedbyanactor, e.g. adatabaseexceptionorsomeothertypeofruntimeexception.
808
+
809
+
Whenthisoccursandtheexceptionisnothandledviaa `try` / `catch` block, theactor's parent will be notified that its child failed with a specific exception type and will use its [supervision strategy](xref:supervision#what-supervision-means) to restart that child.
839
810
840
811
### What happens to the Message
841
812
Ifanexceptionisthrownwhileamessageisbeingprocessed (i.e. takenoutofitsmailboxandhandedovertothecurrentbehavior), thenthismessagewillbelost. Itisimportanttounderstandthatitisnotputbackonthemailbox. Soifyouwanttoretryprocessingofamessage, youneedtodealwithityourselfbycatchingtheexceptionandretryyourflow. Makesurethatyouputaboundonthenumberofretriessinceyoudon't want a system to livelock (so consuming a lot of cpu cycles without making progress).
Copy file name to clipboardExpand all lines: docs/articles/concepts/supervision.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ title: Supervision
7
7
8
8
This document outlines the concept behind supervision and what that means for your Akka.NET actors at run-time.
9
9
10
+
<iframewidth="560"height="315"src="https://www.youtube.com/embed/CC2XdYlpmvo"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
11
+
10
12
## What Supervision Means
11
13
As described in [Actor Systems](xref:actor-systems) supervision describes a dependency relationship between actors: the supervisor delegates tasks to subordinates and therefore must respond to their failures. When a subordinate detects a failure (i.e. throws an exception), it suspends itself and all its subordinates and sends a message to its supervisor, signaling failure. Depending on the nature of the work to be supervised and the nature of the failure, the supervisor has a choice of the following four options:
0 commit comments