Liking cljdoc? Tell your friends :D

salutem.core.checks

Provides constructors, predicates and evaluation functions for checks.

Provides constructors, predicates and evaluation functions for checks.
raw docstring

attemptclj

(attempt check context)
(attempt dependencies trigger-id check context result-channel)

background-checkclj

(background-check check-name check-fn)
(background-check check-name check-fn opts)

Constructs a background check with the provided name and check function.

A background check is one that is evaluated periodically with the result cached until the next evaluation, which will occur once the time-to-live (TTL) of the check has passed.

Background checks are useful for external dependencies where it is important not to perform the check too frequently and where the health status only needs to be accurate to within the TTL.

Takes the following parameters:

  • check-name: a keyword representing the name of the check
  • check-fn: an arity-2 function, with with the first argument being a context map as provided during evaluation or at maintenance pipeline construction and the second argument being a callback function which should be called with the result fo the check to signal the check is complete; note, check functions must be non-blocking.
  • opts: an optional map of additional options for the check, containing:
    • :ttl: a [[duration]] representing the TTL for a result of this check, defaulting to 10 seconds
    • :timeout: a [[duration]] representing the amount of time to wait for the check to complete before considering it failed, defaulting to 10 seconds
Constructs a background check with the provided name and check function.

A background check is one that is evaluated periodically with the result
cached until the next evaluation, which will occur once the time-to-live
(TTL) of the check has passed.

Background checks are useful for external dependencies where it is
important not to perform the check too frequently and where the health
status only needs to be accurate to within the TTL.

Takes the following parameters:

  - `check-name`: a keyword representing the name of the check
  - `check-fn`: an arity-2 function, with with the first argument being a
    context map as provided during evaluation or at maintenance pipeline
    construction and the second argument being a callback function which
    should be called with the result fo the check to signal the check is
    complete; note, check functions _must_ be non-blocking.
  - `opts`: an optional map of additional options for the check, containing:
    - `:ttl`: a [[duration]] representing the TTL for a result of this check,
      defaulting to 10 seconds
    - `:timeout`: a [[duration]] representing the amount of time to wait for
      the check to complete before considering it failed, defaulting to
      10 seconds
raw docstring

background?clj

(background? check)

Returns true if the provided check is a background check, false otherwise.

Returns `true` if the provided check is a background check, `false`
otherwise.
raw docstring

evaluateclj

(evaluate check)
(evaluate check context)

Evaluates the provided check synchronously, returning the result of the evaluation.

Optionally takes a context map containing arbitrary context required by the check in order to run and passed to the check function as the first argument.

Evaluates the provided check synchronously, returning the result of the
evaluation.

Optionally takes a context map containing arbitrary context required
by the check in order to run and passed to the check function as the first
argument.
raw docstring

realtime-checkclj

(realtime-check check-name check-fn)
(realtime-check check-name check-fn opts)

Constructs a realtime check with the provided name and check function.

A realtime check is one that is re-evaluated whenever the check is resolved, with no caching of results taking place.

Realtime checks are useful when the accuracy of the check needs to be very accurate or where the check itself is inexpensive.

Takes the following parameters:

  • check-name: a keyword representing the name of the check
  • check-fn: an arity-2 function, with with the first argument being a context map as provided during evaluation or at maintenance pipeline construction and the second argument being a callback function which should be called with the result fo the check to signal the check is complete; note, check functions must be non-blocking.
  • opts: an optional map of additional options for the check, containing:
    • :timeout: a [[duration]] representing the amount of time to wait for the check to complete before considering it failed, defaulting to 10 seconds
Constructs a realtime check with the provided name and check function.

A realtime check is one that is re-evaluated whenever the check is resolved,
with no caching of results taking place.

Realtime checks are useful when the accuracy of the check needs to be very
accurate or where the check itself is inexpensive.

Takes the following parameters:

  - `check-name`: a keyword representing the name of the check
  - `check-fn`: an arity-2 function, with with the first argument being a
    context map as provided during evaluation or at maintenance pipeline
    construction and the second argument being a callback function which
    should be called with the result fo the check to signal the check is
    complete; note, check functions _must_ be non-blocking.
  - `opts`: an optional map of additional options for the check, containing:
    - `:timeout`: a [[duration]] representing the amount of time to wait for
      the check to complete before considering it failed, defaulting to
      10 seconds
raw docstring

realtime?clj

(realtime? check)

Returns true if the provided check is a realtime check, false otherwise.

Returns `true` if the provided check is a realtime check, `false`
otherwise.
raw docstring

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

× close