Skip to content

Instantly share code, notes, and snippets.

@mhaemmerle
Created September 14, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhaemmerle/3723317 to your computer and use it in GitHub Desktop.
Save mhaemmerle/3723317 to your computer and use it in GitHub Desktop.
failed agent behaviour
(def a (agent 1))
(set-error-mode! a :fail)
(set-error-handler! a (fn [failed-agent exception]
(println "error-handler" failed-agent exception)
(restart-agent failed-agent @failed-agent)
(println "restart done")))
(send a / 0)
(await a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment