cljs-http icon indicating copy to clipboard operation
cljs-http copied to clipboard

cljs-http starts looping when providing custom channel

Open fluke777 opened this issue 10 years ago • 3 comments

Not sure if I am not using it correctly or this is a bug.

When I write this simple program

(def c (async/chan))

(go (while true
  (prn (async/<! c))))

(go
  (let [resp (async/<! (http/get "some_api" {:accept "application/json"}))]
    (async/>! c resp)))

Everything works fine. But when I run this one

(def c (async/chan))

(go (while true
  (prn (async/<! c))))

(go
  (http/get "some_api" {:accept "application/json" :channel c}))

everything goes awry. Tons of nils are printed to the console and it never stops. I would have thought these two are meant to be equivalent?

Running on [cljs-http "0.1.35"]

fluke777 avatar Jul 19 '15 18:07 fluke777

Seing the same behaviour with [cljs-http "0.1.39"].

profil avatar Jan 01 '16 19:01 profil

Hi Daniel, I'm in Sri Lanka at the moment and AFK for the next 4 weeks. I can take a look at this when I am back. Sorry, Roman. On 2 Jan 2016 12:52 am, "Daniel Pettersson" [email protected] wrote:

Seing the same behaviour with [cljs-http "0.1.39"].

— Reply to this email directly or view it on GitHub https://github.com/r0man/cljs-http/issues/66#issuecomment-168333040.

r0man avatar Jan 02 '16 18:01 r0man

I ran into this as well on v 0.1.46. Wondering if anyone found a workaround?

kirahowe avatar Feb 24 '21 22:02 kirahowe