r0man / cljs-http

A ClojureScript HTTP library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cljs-http starts looping when providing custom channel

fluke777 opened this issue · 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"]

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

commented

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" notifications@github.com
wrote:

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


Reply to this email directly or view it on GitHub
#66 (comment).

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