Fork me on GitHub

@dominicm it seems the juxt.clip.core/stop calls the component's stop function twice. is that intended? im cleaning up dbs from my stop functions and they are not idempotent, so they fail on the 2nd run.

(def cfg {:components
            {:wheel {:start {:part "wheel"}
                     :stop  prn}}})
  (def sys (clip/start cfg))
  (clip/stop cfg sys)

=> #'repl/cfg
=> #'repl/sys
{:part "wheel"}
{:part "wheel"}
=> {:wheel nil}
and the implementation indeed seems to simply repeat the stop operation:
(defn stopping-f
  [[k {:keys [stop]}]]
  (fn [rf acc]
    (stop! (get acc k) stop)
    (-> acc
        (rf k (stop! (get acc k) stop)))))


it seems to me that stopping-f is a reducer, but it only implements a 2-arity version, but the 1st (stop! (get acc k) stop) was intended for a single arity version or something...?


I've done something stupid it seems. I'll take a look this weekend.

👍 4
❤️ 4