diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2019-11-03 23:17:13 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2019-11-03 23:17:13 +0800 |
commit | f7b2a7b84a6ca561fad2a534091db93dc9486754 (patch) | |
tree | 4060a60246760bebbda607a6a603ea5b1ea7be99 | |
parent | b8a67854660887398cd1247b0248c3ad134029be (diff) | |
download | cask-f7b2a7b84a6ca561fad2a534091db93dc9486754.tar.gz cask-f7b2a7b84a6ca561fad2a534091db93dc9486754.tar.bz2 cask-f7b2a7b84a6ca561fad2a534091db93dc9486754.zip |
actor readme
-rw-r--r-- | docs/pages/4 - Cask Actors.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/pages/4 - Cask Actors.md b/docs/pages/4 - Cask Actors.md index 9c739ad..dca3afe 100644 --- a/docs/pages/4 - Cask Actors.md +++ b/docs/pages/4 - Cask Actors.md @@ -72,6 +72,12 @@ 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. +Cask Actors are meant to manage mutable state internal to the Actor. Note that +it is up to you to mark the state `private` to avoid accidental external access. +Each actor may run on a different thread, and the same actor may run on +different threads at different times, so you should ensure you do not mutate +shared mutable state otherwise you risk race conditions. + ## Example: Asynchronous Logging using an Actor Here is a small demonstration of using a `cask.actor.SimpleActor` to perform |