Liking cljdoc? Tell your friends :D

binance-clj.websocket

Shared resilient WebSocket connection, subscription, and event-buffer manager.

Shared resilient WebSocket connection, subscription, and event-buffer manager.
raw docstring

close!clj

(close! connection)

Closes the socket, scheduler, and transport idempotently.

Closes the socket, scheduler, and transport idempotently.
sourceraw docstring

connect!clj

(connect! connection)

Opens the connection synchronously and restores desired subscriptions.

Opens the connection synchronously and restores desired subscriptions.
sourceraw docstring

create-connectionclj

(create-connection
  {:keys [buffer-capacity clock heartbeat-timeout-ms jitter-fn message-observer
          monotonic-clock normalizer overflow-policy reconnect-base-ms
          reconnect-max-ms renewal-ms restore-requests-fn scheduler sleep-fn
          transport url]
   :or {normalizer identity
        clock (fn* [] (System/currentTimeMillis))
        buffer-capacity 1024
        sleep-fn (fn* [p1__3419#] (Thread/sleep p1__3419#))
        heartbeat-timeout-ms default-heartbeat-timeout-ms
        overflow-policy :drop-oldest
        reconnect-max-ms 30000
        restore-requests-fn (constantly [])
        monotonic-clock (fn* [] (quot (System/nanoTime) 1000000))
        jitter-fn (fn [upper] (if (pos? upper) (rand-int (inc upper)) 0))
        reconnect-base-ms 250
        message-observer (constantly nil)
        renewal-ms default-renewal-ms}})

Creates a disconnected, shareable WebSocket manager.

restore-requests-fn is called after every successful connection, enabling freshly timestamped/signed User Data Stream subscription requests.

Creates a disconnected, shareable WebSocket manager.

`restore-requests-fn` is called after every successful connection, enabling
freshly timestamped/signed User Data Stream subscription requests.
sourceraw docstring

poll-event!clj

(poll-event! connection)
(poll-event! connection timeout-ms)

Returns the next buffered event, or nil after timeout-ms.

Returns the next buffered event, or nil after timeout-ms.
sourceraw docstring

renew!clj

(renew! connection)

Schedules an immediate planned reconnect using the normal restore path.

Schedules an immediate planned reconnect using the normal restore path.
sourceraw docstring

send!clj

(send! connection request)

Sends one JSON request map on an open connection.

Sends one JSON request map on an open connection.
sourceraw docstring

snapshotclj

(snapshot connection)

Returns safe connection, subscription, and backpressure state.

Returns safe connection, subscription, and backpressure state.
sourceraw docstring

subscribe!clj

(subscribe! connection stream)

Adds a market stream once and subscribes immediately when connected.

Adds a market stream once and subscribes immediately when connected.
sourceraw docstring

unsubscribe!clj

(unsubscribe! connection stream)

Removes a desired market stream and sends UNSUBSCRIBE when connected.

Removes a desired market stream and sends UNSUBSCRIBE when connected.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close