missionary 2024-06-12

Hi guys! I don’t understand why this code doesn’t return "foo"

(defn http-get [url]
  (fn [success! failure!]
    (let [fut (http/get url {:async? true
                             :oncancel #(failure! (ex-info "GET request interrupted." {:url url}))}
                success! failure!)]
      #(.cancel ^java.util.concurrent.Future fut true))))

(def t (m/timeout (http-get "") 5 "foo"))

(t (fn [res] (prn res))
   (fn []))

✅ 1

it works on my machine

1

Sorry guys! I tested on another computer and it works. It's weird.

Maybe it's just a http requesting failure (since the failure handling does nothing).

also the failure handler doesn't have an argument and it should, I think it matters in missionary

☝️ 1