fixed chunked response folding bug
upgrade jetty-* 9.3.* changelog
use latest core async
the http client now returns request as an async/promise-chan instead of a async/chan
Add HTTP2 & HTTP2C support in server, togglable using :http2?
and
:http2c?
options.
Add pluggable transports to http client
ex: (http/client {:transport :http2})
, (http/client {:transport transport-instance})
Avoid triggering init of logging at compile time see #22
Kill reflection introduced in 0.6.5
Bump clojure dependency to 1.7.0
Allow more options for streaming, see https://github.com/mpenet/jet/pull/21
fix tests
use jetty-* 9.3.* changelog
!! Breaking jetty 9.3.0 requires java8
:fold-chunked-response? true
the body
channel will contain a single value that will only be decoded after
accumulation of all the chunks. This makes working with :as :json
on
a server which returns chunked response easier (ex; ElasticSearch).Backward compatible change
HTTP client api overhaul, all http calls now take a mandatory client argument, following the "browser model" behind jetty9 client API. This also fixes a file descriptor leak from 0.4.0*.
HTTP client now puts response headers as soon as headers come in.
websocket is now managed via a single handler, like a normal ring-handler. It now receives a RING compliant request map in addition of the 3 channels and the ws instance. That should make it compatible with RING compatible routing libraries and a large number of middlewares.
This forced me to change run-jetty a bit to take a single map
argument that contains all the usuall options, but also
:ring-handler
and :websocket-handler
.
(run-jetty {:ring-handler (fn [request] {:status 201 :body "foo"})
:wesocket-handler (fn [{:keys [in out ctrl params headers]}] ...)
:port 8080})
(require '[clojure.core.async :as async])
(defn handler
[request]
(let [ch (async/chan 1)]
(async/go
(dotimes [i 5]
(async/<! (async/timeout 300))
(async/>! ch (str i "\n")))
(async/close! ch))
{:body ch
:headers {"Content-Type" "prout"}
:status 400}))
(qbits.jet.server/run-jetty handler {:port ...})
:content-type
in http client:(qbits.jet.client.http/get "http://foo.com" {:content-type :application/json, ...})
(qbits.jet.client.http/get "http://foo.com" {:content-type [:application/json "UTF-8"], ...})
(qbits.jet.client.http/get "http://foo.com" {:content-type ["application/json" "UTF-8"], ...})
add basic auth
split client/request objects, allowing client reuse in requests
qbits.jet.websocket.client/ws-client
is now qbits.jet.websocket.client/connect!
Improved http client:
add post/get/put/delete/trace/head sugar
support for post params
:as auto decoding of content to clojure ds
tests now run on jet http client (removed clj-http dependency)
Allow to pass factory functions for core.async channels used on WebSocket objects, see run-jetty and client docstrings.
Add options on HTTP and WebSocket clients
Removed ::connect event from ctrl channel, it was a bit useless given that the ctrl channel gets created on connect, so its existence is basically equivalent to the event.
Use async/go & >! for feeding data to channels instead of put!, the later could result in dropped values even with fixed size buffers. Additionaly this should allow for better flow control.
Can you improve this documentation? These fine people already did:
Max Penet & Rajesh ShahEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close