Liking cljdoc? Tell your friends :D

taoensso.sente.interfaces

Alpha, subject to change. Public interfaces / extension points.

Alpha, subject to change.
Public interfaces / extension points.
raw docstring

IPackerclj/sprotocol

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.

packclj/s

(pack _ x)

unpackclj/s

(unpack _ x)
raw docstring

IServerChanclj/sprotocol

sch-close!clj/s

(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?clj/s

(sch-open? sch)

Returns true iff the channel is currently open.

Returns true iff the channel is currently open.

sch-send!clj/s

(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.

IServerChanAdapterclj/sprotocol

ring-req->server-ch-respclj/s

(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