 
     (->> sm
          (iterate transition)
-         (take-while #(not= :machine/stop (:state %)))
+         (take-while #(not= :machina/stop (:state %)))
          (last))
 
 

        (assoc sm :state :write-to-file))}

     :error-policies
     {:machine/default {:type        :retry
                        :max-retry   :forever
                        :retry-delay [:random-exp-backoff :base 3000 :+/- 0.35 :max 25000]}


(ns samsara.machina.core)
;;
;; This namespace contains an REPL exploration session on
;; various possible implementation of a State Machine
;; in Clojure. There are several characteristics that
;; I'm keen to explore and achieve in the final system
;; such as: simplicity, flexibility, robustness,
;; speed, and more.
;; I'll be writing several implementations of the
;; state machine to solve a simple problem
;; and try to evaluate which compromises I'm making
;; in regards to the aforementioned characteristics.
;;


;;
;; TODO: managed transition
