Liking cljdoc? Tell your friends :D

net.modulolotus.truegrit.time-limiter

Implements time limiters, aka timeouts, which throw exceptions if a fn takes too long to return.

See https://resilience4j.readme.io/docs/timeout

Implements time limiters, aka timeouts, which throw exceptions if a fn takes too long to return.

See https://resilience4j.readme.io/docs/timeout
raw docstring

*default-config*clj

Set this to override the R4j defaults with your own

Set this to override the R4j defaults with your own
sourceraw docstring

add-listenersclj

(add-listeners tl {:keys [on-success on-error on-timeout]})

Add event handlers for TimeLimiter lifecycle events.

Config map options

  • :on-success - a handler that runs after a successful call - receives a TimeLimiterOnSuccessEvent
  • :on-error - a handler that runs after an error - receives a TimeLimiterOnErrorEvent
  • :on-timeout - a handler that runs after a call times out - receives a TimeLimiterOnTimeoutEvent
Add event handlers for TimeLimiter lifecycle events.

Config map options
 - `:on-success` - a handler that runs after a successful call - receives a TimeLimiterOnSuccessEvent
 - `:on-error` - a handler that runs after an error - receives a TimeLimiterOnErrorEvent
 - `:on-timeout` - a handler that runs after a call times out - receives a TimeLimiterOnTimeoutEvent
sourceraw docstring

retrieveclj

(retrieve f)

Retrieves a time-limiter from a wrapped fn

Retrieves a time-limiter from a wrapped fn
sourceraw docstring

time-limiterclj

(time-limiter config)

Creates a TimeLimiter

Creates a TimeLimiter
sourceraw docstring

time-limiter-configclj

(time-limiter-config config)

Creates a Resilience4j TimeLimiterConfig.

Config map options

  • :cancel-running-future? - should .cancel() be called on the running Future? - defaults to true
  • :timeout-duration - how long to wait before timing out - defaults to 1000 ms - accepts number of ms or java.time.Duration
Creates a Resilience4j TimeLimiterConfig.

Config map options
 - `:cancel-running-future?` - should `.cancel()` be called on the running Future? - defaults to true
 - `:timeout-duration` - how long to wait before timing out - defaults to 1000 ms - accepts number of ms or java.time.Duration
sourceraw docstring

wrapclj

(wrap f tl)

Wraps a function in a TimeLimiter. Throws TimeoutException if it times out.

Attaches the time limiter as metadata on the wrapped fn at :truegrit/time-limiter

Wraps a function in a TimeLimiter. Throws TimeoutException if it times out.

Attaches the time limiter as metadata on the wrapped fn at :truegrit/time-limiter
sourceraw docstring

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

× close