Alpha, subject to change. Public interfaces / extension points.
Alpha, subject to change. Public interfaces / extension points.
Extension pt. for client<->server comms data un/packers: arbitrary Clojure data <-> serialized strings.
Extension pt. for client<->server comms data un/packers: arbitrary Clojure data <-> serialized strings.
(pack _ x)
(unpack _ x)
(sch-close! sch)
If the channel is open when called: closes the channel and returns true. Otherwise noops and returns false.
If the channel is open when called: closes the channel and returns true. Otherwise noops and returns false.
(sch-open? sch)
Returns true iff the channel is currently open.
Returns true iff the channel is currently open.
(sch-send! sch websocket? msg)
If the channel is open when called: sends a message over channel and returns true. Otherwise noops and returns false.
If the channel is open when called: sends a message over channel and returns true. Otherwise noops and returns false.
(ring-req->server-ch-resp sch-adapter ring-req callbacks-map)
Given a Ring request (WebSocket handshake or Ajax GET/POST), returns a Ring response map with a web-server-specific channel :body that implements Sente's IServerChan protocol.
Configures channel callbacks with a callbacks map using keys:
:on-open - (fn [server-ch websocket?]) called exactly once after
channel is available for sending.
:on-close - (fn [server-ch websocket? status]) called exactly once
after channel is closed for any cause, incl. an explicit
call to close!
. status
type is currently undefined.
:on-msg - (fn [server-ch websocket? msg]) called for each String or
byte[] message received from client.
:on-error - (fn [server-ch websocket? error]) currently unused.
Given a Ring request (WebSocket handshake or Ajax GET/POST), returns a Ring response map with a web-server-specific channel :body that implements Sente's IServerChan protocol. Configures channel callbacks with a callbacks map using keys: :on-open - (fn [server-ch websocket?]) called exactly once after channel is available for sending. :on-close - (fn [server-ch websocket? status]) called exactly once after channel is closed for any cause, incl. an explicit call to `close!`. `status` type is currently undefined. :on-msg - (fn [server-ch websocket? msg]) called for each String or byte[] message received from client. :on-error - (fn [server-ch websocket? error]) currently unused.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close