From b8a67854660887398cd1247b0248c3ad134029be Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 3 Nov 2019 23:12:51 +0800 Subject: actor readme --- docs/pages/4 - Cask Actors.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/pages/4 - Cask Actors.md b/docs/pages/4 - Cask Actors.md index ecfaedb..9c739ad 100644 --- a/docs/pages/4 - Cask Actors.md +++ b/docs/pages/4 - Cask Actors.md @@ -64,6 +64,14 @@ instead of many individual. `StateMachineActor` allows you to define actors via a set of distinct states, each of which has a separate `run` callback that transitions the actor to a different state. +Note that any exception that is thrown while an Actor is processing a message +(or batch of messages, in the case of `BatchActor`) is simply reported to the +`cask.actor.Context`'s `reportFailure` function: the default just prints to the +console using `.printStackTrace()`, but you can hook in to pass the exceptions +elsewhere e.g. if you have a remote error aggregating service. The actor +continues processing messages after the failure in the state that it was left +in. + ## Example: Asynchronous Logging using an Actor Here is a small demonstration of using a `cask.actor.SimpleActor` to perform -- cgit v1.2.3