component

2016-05-12T16:52:27.000053Z

@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)))

2016-05-12T16:59:39.000054Z

interesting. in that case you’re blocking whatever thread you invoke await-termination on, no? I had wanted to avoid that behavior if possible

2016-05-12T23:15:26.000055Z

ya i have a worker service that is just a bunch of async loops. so i block the main thread.