Liking cljdoc? Tell your friends :D
ClojureScript only.

com.fulcrologic.fulcro.networking.tenacious-remote

A wrapper for remotes that adds automatic retry with exponential back-off behavior. This makes the remote more tolerant of flaky network communications, and is a simple wrapper that should work with any remote implementation. NOTE: Fulcro websockets already has automatic retry support which works a bit differently than this one. Be careful that you understand what you are doing if you configure them both at the same time.

See com.fulcrologic.fulcro.offline for features that help support true offline modes of operation.

A wrapper for remotes that adds automatic retry with exponential back-off behavior. This makes the remote more
tolerant of flaky network communications, and is a simple wrapper that should work with any remote implementation.
NOTE: Fulcro websockets already has automatic retry support which works a bit differently than this one. Be careful
that you understand what you are doing if you configure them both at the same time.

See `com.fulcrologic.fulcro.offline` for features that help support true offline modes of operation.
raw docstring

tenacious-remotecljs

(tenacious-remote real-remote options)

Wrap a Fulcro remote so that attempted communication that fails with a network error will be retried according to the configured options.

  • real-remote - The real remote that is used for network communication.
  • options - A map of configuration options which can contains: ** :network-error? - A (fn [result] boolean?) that can indicate when the error is something that appears to be a low-level network error. Only network errors are retried. The default will work for Fulcro http-remote, but you must define this if you use an alternate remote type. ** :max-attempts - The number of times the request will be retried due to network failures. The default is 3. ** :max-delay - Retries use quadratic back-off on retries to prevent flooding your servers with requests when a server outage is the cause of the retries (1s, 4s, 9s, 16s, 25s, etc.). By default the maximum retry delay is 30000ms (30 seconds). Use this option to change the max delay between retries.

Returns the same top-level map that the wrapped remote would have returned, with :transmit! wrapped with retry behavior. This means any other top-level keys that would have normally come from your remote will still be at the top-level of the map.

In order words:

(tenacious-remote (http-remote ...) {})

is roughly equivalent to (update (http-remote ...) :transmit! ...).

Wrap a Fulcro remote so that attempted communication that fails with a network error will be retried according
to the configured options.

* `real-remote` - The real remote that is used for network communication.
* `options` - A map of configuration options which can contains:
** `:network-error?` - A `(fn [result] boolean?)` that can indicate when the error is something that appears to be
   a low-level network error. Only network errors are retried. The default will work for Fulcro http-remote, but
    you must define this if you use an alternate remote type.
** `:max-attempts` - The number of times the request will be retried due to network failures. The default is 3.
** `:max-delay` - Retries use quadratic back-off on retries to prevent flooding your servers with requests when
    a server outage is the cause of the retries (1s, 4s, 9s, 16s, 25s, etc.).
    By default the maximum retry delay is 30000ms (30 seconds). Use this option to change the max delay between retries.

Returns the same top-level map that the wrapped remote would have returned, with `:transmit!` wrapped with retry
behavior. This means any other top-level keys that would have normally come from your remote will still be at the
top-level of the map.

In order words:

(tenacious-remote (http-remote ...) {})

is roughly equivalent to `(update (http-remote ...) :transmit! ...)`.
sourceraw docstring

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

× close