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 :source - a core.async channel to read from :sink - a core.async channel to write to
Takes the following options:
:format - a formatter from haslett.format :source - a custom channel to use as the source :sink - a custom channel to use as the sink :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 :source - a core.async channel to read from :sink - a core.async channel to write to Takes the following options: :format - a formatter from haslett.format :source - a custom channel to use as the source :sink - a custom channel to use as the sink :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 is a website building & hosting documentation for Clojure/Script libraries
× close