@mss i do something like this in my clojure services to await shutdown (i call it from main):
(defn await-termination []
(let [termination-channel (async/chan)]
(.addShutdownHook (Runtime/getRuntime)
(Thread. #(do
(log/info "received shutdown signal")
(async/close! termination-channel))))
(async/<!! termination-channel)))
interesting. in that case you’re blocking whatever thread you invoke await-termination
on, no? I had wanted to avoid that behavior if possible
ya i have a worker service that is just a bunch of async loops. so i block the main thread.