Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.janitor

The one background worker for maintenance: work that keeps a store small and that no user waits for.

One daemon thread at the lowest priority takes the tasks one after another. Two chores never run at the same time, and an idle worker waits without a poll. A task is data, {:id :run :delay-ms :every-ms}, so each task has its own times: submit! runs it after :delay-ms and then, with :every-ms, again that long after each run ends.

The worker writes nothing about itself. A run that did work leaves one line with the task, the time and the result of the run, and a run that failed leaves one warning. A run that answers nil found no work and leaves no line.

The thread starts at the first submit!, never at namespace load, so the native image holds no thread from its build. This namespace requires only the shared leaf, so the owner of each store can give its own chore to the worker.

The one background worker for maintenance: work that keeps a store small and
that no user waits for.

One daemon thread at the lowest priority takes the tasks one after another. Two
chores never run at the same time, and an idle worker waits without a poll. A
task is data, `{:id :run :delay-ms :every-ms}`, so each task has its own times:
[[submit!]] runs it after `:delay-ms` and then, with `:every-ms`, again that
long after each run ends.

The worker writes nothing about itself. A run that did work leaves one line with
the task, the time and the result of the run, and a run that failed leaves one
warning. A run that answers nil found no work and leaves no line.

The thread starts at the first [[submit!]], never at namespace load, so the
native image holds no thread from its build. This namespace requires only the
shared leaf, so the owner of each store can give its own chore to the worker.
raw docstring

cancel!clj

(cancel! id)

Take the task id off the worker. Answer true when it waited or repeated. A run in progress finishes.

Take the task `id` off the worker. Answer true when it waited or repeated. A run
in progress finishes.
sourceraw docstring

queuedclj

(queued)

The ids of the tasks that wait or repeat.

The ids of the tasks that wait or repeat.
sourceraw docstring

submit!clj

(submit! {:keys [id run delay-ms every-ms]})

Give task to the worker and answer its :id.

:run is a function of no arguments. It runs on the worker thread after :delay-ms (default 0). With :every-ms it runs again that long after each run ends, until cancel!. A task with the id of a waiting or repeating task replaces that task. A run in progress finishes first, so two tasks never run at the same time. An :every-ms that is not more than 0 throws, and the waiting task stays.

:run answers nil when it found no work. Each other answer goes to the log with the time of the run. A throw goes to the log as a warning, and a repeating task keeps its times. The worker thread has no dynamic bindings of the caller: a task that needs them wraps :run in bound-fn*.

Give `task` to the worker and answer its `:id`.

`:run` is a function of no arguments. It runs on the worker thread after
`:delay-ms` (default 0). With `:every-ms` it runs again that long after each run
ends, until [[cancel!]]. A task with the id of a waiting or repeating task
replaces that task. A run in progress finishes first, so two tasks never run at
the same time. An `:every-ms` that is not more than 0 throws, and the waiting
task stays.

`:run` answers nil when it found no work. Each other answer goes to the log
with the time of the run. A throw goes to the log as a warning, and a repeating
task keeps its times. The worker thread has no dynamic bindings of the caller:
a task that needs them wraps `:run` in `bound-fn*`.
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