A namespace for opening WebSockets in ClojureScript.
A namespace for opening WebSockets in ClojureScript.
(close stream)Close a stream opened by connect.
Close a stream opened by connect.
(connect url)(connect url options)Create a WebSocket to the specified URL, and returns a 'stream' map of four keys:
:socket - contains the WebSocket object :close-status - a promise channel that contains the final close status :in - a core.async channel to read from :out - a core.async channel to write to
Takes the following options:
:format - a formatter from haslett.format :in - a custom channel to use as the reader :out - a custom channel to use as the writer :protocols - passed to the WebSocket, a vector of protocol strings :binary-type - passed to the WebSocket, may be :blob or :arraybuffer :close-chan? - true if channels should be closed if WebSocket is closed (defaults to true)
The WebSocket may either be closed directly, or by closing the stream's :sink channel.
Create a WebSocket to the specified URL, and returns a 'stream' map of four
keys:
:socket - contains the WebSocket object
:close-status - a promise channel that contains the final close status
:in - a core.async channel to read from
:out - a core.async channel to write to
Takes the following options:
:format - a formatter from haslett.format
:in - a custom channel to use as the reader
:out - a custom channel to use as the writer
:protocols - passed to the WebSocket, a vector of protocol strings
:binary-type - passed to the WebSocket, may be :blob or :arraybuffer
:close-chan? - true if channels should be closed if WebSocket is closed
(defaults to true)
The WebSocket may either be closed directly, or by closing the
stream's :sink channel.(connected? {:keys [close-status]})Return true if the stream is currently connected.
Return true if the stream is currently connected.
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 |