debugging piped-input-stream

60 views
Skip to first unread message

Brian Craft

unread,
May 2, 2017, 5:51:32 PM5/2/17
to Ring
I'm trying to use piped-input-stream in ring 1.2.2. So far, the server hangs and the 'write' function appears to never be called. Not sure how to debug from here.

The code looks like this:

(defn get-stream []
  (info "get-stream")
  (piped-input-stream
    (fn [ostream]
      (info "starting ostream")
      (spit ostream "hello"))))

(defroutes routes
    (GET "/stream/" []  (get-stream)))

Calling routes, I get a response map:

  (routes { :uri "/stream/"
                :request-method :get})
; -> {:status 200, :headers {}, :body #<PipedInputStream java.io.PipedInputStream@2bbd50d2>}

When I wget /stream/, the log shows "get-stream", but no "starting ostream", and the server never responds.


Brian Craft

unread,
May 2, 2017, 6:05:56 PM5/2/17
to Ring
Apparently this was a transient repl state. It's working after reloading ring.util.io.

James Reeves

unread,
May 2, 2017, 6:07:34 PM5/2/17
to Ring
Sorry, I can't reproduce your problem. Can you provide a little more information about your project dependencies, Java version, OS etc.?

- James

--
You received this message because you are subscribed to the Google Groups "Ring" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages