A Good Enough ™ websocket implementation. Provides a server side websocket channel supporting puts, takes, and automatic reconnect. The intended use case for this transport type is server-to-server applications.
A Good Enough ™ websocket implementation. Provides a server side websocket channel supporting puts, takes, and automatic reconnect. The intended use case for this transport type is server-to-server applications.
(websocket! uri
{:keys [buffer log heartbeat-interval pong-timeout
reconnect-interval builder-fn xf-in xf-out ex-handler]
:or {buffer 10
log (constantly nil)
heartbeat-interval 5000
pong-timeout 10000
reconnect-interval 1000
builder-fn (constantly nil)}})Returns a Channel ch you can put to and take from without worrying
about reconnects.
Options:
:buffer – size of the internal buffers (default 10) :log – optional fn called on lifecycle events (default (constantly nil)) - expects signature of (fn [& xs]) :heartbeat-interval – millis between pings (default 5000) :pong-timeout – max millis to wait for a pong (default 10000) :reconnect-interval – millis to wait before retrying (default 1000) :builder-fn - optional function that will receive the WebSocket$Builder instance - useful for further configuration - i.e headers - return value is ignored :xf-in - optional transducer applied to the write-ch :xf-out - optional transducer applied to the read-ch :ex-handler - optional ex-handler for the read-ch only- follows the same rules as clojure.core.async/chan
Returns a Channel `ch` you can put to and take from without worrying about reconnects. Options: :buffer – size of the internal buffers (default 10) :log – optional fn called on lifecycle events (default (constantly nil)) - expects signature of (fn [& xs]) :heartbeat-interval – millis between pings (default 5000) :pong-timeout – max millis to wait for a pong (default 10000) :reconnect-interval – millis to wait before retrying (default 1000) :builder-fn - optional function that will receive the WebSocket$Builder instance - useful for further configuration - i.e headers - return value is ignored :xf-in - optional transducer applied to the write-ch :xf-out - optional transducer applied to the read-ch :ex-handler - optional ex-handler for the read-ch only- follows the same rules as clojure.core.async/chan
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |