missionary

J 2024-06-12T15:16:38.310529Z

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
leonoel 2024-06-12T20:08:42.199389Z

it works on my machine

1
J 2024-06-13T09:03:06.395249Z

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

lotuc 2024-06-13T09:26:11.481669Z

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

Eric Dvorsak 2024-06-14T06:29:10.083129Z

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

☝️ 1