Fork me on GitHub
#missionary
<
2023-01-30
>
martinklepsch10:01:22

Is there a way to run a callback when a flow is cancelled?

leonoel10:01:27

(require '[missionary.core :as m])
(import 'missionary.Cancelled)
(defn on-cancelled [cb flow]
  (m/ap
    (try (m/?> flow)
         (catch Cancelled e
           (cb) (throw e)))))

martinklepsch11:01:44

Thanks, thats exactly what I was looking for 🙂