Liking cljdoc? Tell your friends :D

cl4cl.http

The only namespace that touches the network. Sends request maps with java.net.http and retries failures according to a policy map.

The only namespace that touches the network. Sends request maps with
java.net.http and retries failures according to a policy map.
raw docstring

backoff-msclj

(backoff-ms {:keys [base-ms cap-ms]} attempt e jitter)

How long to wait before retry number attempt (from 1): the server's retry-after if it sent one, else exponential backoff from :base-ms, capped at :cap-ms, scaled by jitter, a number in [0, 1).

How long to wait before retry number attempt (from 1): the server's
retry-after if it sent one, else exponential backoff from :base-ms,
capped at :cap-ms, scaled by jitter, a number in [0, 1).
sourceraw docstring

http-clientclj

(http-client {:keys [connect-timeout-ms]})

A java.net.http client. One instance is meant to be shared.

A java.net.http client. One instance is meant to be shared.
sourceraw docstring

send!clj

(send! http-client request as)

Send a request map {:method :url :headers :body :timeout-ms} and return {:status :headers :body}. :body is a string, or an open InputStream when as is :stream; the caller must then close it. A request that gets no response throws a :cl4cl.error/connection ex-info.

Send a request map {:method :url :headers :body :timeout-ms} and return
{:status :headers :body}. :body is a string, or an open InputStream when
as is :stream; the caller must then close it. A request that gets no
response throws a :cl4cl.error/connection ex-info.
sourceraw docstring

with-retryclj

(with-retry {:keys [max sleep]
             :or {sleep (fn* [p1__2019#] (Thread/sleep (long p1__2019#)))}
             :as policy}
            f)

Call the thunk f, retrying while it throws a retryable cl4cl error, up to :max extra attempts. :sleep, a function of milliseconds, is optional and exists so tests need not wait.

Call the thunk f, retrying while it throws a retryable cl4cl error, up
to :max extra attempts. :sleep, a function of milliseconds, is optional
and exists so tests need not wait.
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