Liking cljdoc? Tell your friends :D
Clojure only.

qbits.jet.client.websocket


connect!clj

(connect! client
          url
          handler
          &
          [{:as options
            :keys [in out ctrl executor ssl-context-factory async-write-timeout
                   connect-timeout max-idle-timeout
                   max-binary-message-buffer-size max-text-message-buffer-size
                   subprotocols daemon? middleware]
            :or {in async/chan out async/chan ctrl async/chan}}])

Takes a WebSocketClient, a url, a handler, an option map and returns a websocket client.

The option map can take the following keys:

  • :executor - java.util.concurrent.Executor instance
  • :ssl-context-factory - SSLContextFactory instance to be use to perform wss requests http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/util/ssl/SslContextFactory.html
  • :in - fn that returns the :in channel that the handler will receive - defaults to c.core.async/chan
  • :out - fn that returns the :in channel that the handler will receive - defaults to c.core.async/chan
  • :ctrl - fn that returns the :in channel that the handler will receive - defaults to c.core.async/chan

The handler receives a map of:

  • :in - core.async chan that receives data sent by the client
  • :out - core async chan you can use to send data to client, or close the connection by closing the channel
  • :ctrl - core.asyn chan that received control messages such as: ``[::error e],[::close reason]`
  • :ws - qbits.jet.websocket/WebSocket instance
Takes a WebSocketClient, a url, a handler, an option map and returns a websocket
client.

The option map can take the following keys:

* `:executor` - java.util.concurrent.Executor instance
* `:ssl-context-factory` - SSLContextFactory instance to be use to perform wss
requests http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/util/ssl/SslContextFactory.html
* `:in` - fn that returns the :in channel that the handler will receive -
defaults to c.core.async/chan
* `:out` - fn that returns the :in channel that the handler will receive -
defaults to c.core.async/chan
* `:ctrl` - fn that returns the :in channel that the handler will receive -
defaults to c.core.async/chan

The handler receives a map of:

* `:in` - core.async chan that receives data sent by the client
* `:out` - core async chan you can use to send data to client, or close the
connection by closing the channel
* `:ctrl` - core.asyn chan that received control messages such as:
``[::error e]`, `[::close reason]`
* `:ws` - qbits.jet.websocket/WebSocket instance
raw docstring

Connectionclj

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close