Liking cljdoc? Tell your friends :D

vaelii.impl.progress

Progress lines for a long loop, logged at :info through Trove. A loop that ends within first-line-ms prints nothing; a longer one prints a line each time its elapsed time doubles while the doubled time stays within max-gap-ms, then one each max-gap-ms, and a closing line. A line falls due on a tick or on a timer, so a step that ticks nothing for 15 s still prints one. A reporter is a value the loop holds and ticks, opened with with-open; no dynamic var carries it. See docs/operations.md, "Progress lines".

Progress lines for a long loop, logged at `:info` through Trove.  A loop that ends
within `first-line-ms` prints nothing; a longer one prints a line each time its elapsed
time doubles while the doubled time stays within `max-gap-ms`, then one each
`max-gap-ms`, and a closing line.  A line falls due on a
tick or on a timer, so a step that ticks nothing for 15 s still prints one.  A reporter
is a value the loop holds and ticks, opened with `with-open`; no dynamic var carries it.
See docs/operations.md, "Progress lines".
raw docstring

done!clj

(done! r)

Close the loop r reports: stop its timer, and log the closing line when a progress line was logged.

Close the loop `r` reports: stop its timer, and log the closing line when a progress
line was logged.
sourceraw docstring

eachclj

(each r coll)

coll as a lazy seq that ticks r once per element it hands out, for a loop written as a doseq, run! or reduce over coll. Unchunked, so the count is the element the loop is on rather than the end of a 32-element chunk.

`coll` as a lazy seq that ticks `r` once per element it hands out, for a loop written
as a `doseq`, `run!` or `reduce` over `coll`.  Unchunked, so the count is the element
the loop is on rather than the end of a 32-element chunk.
sourceraw docstring

first-line-msclj

How long a loop runs before its first line.

How long a loop runs before its first line.
sourceraw docstring

max-gap-msclj

The longest wait between two lines of one loop, and the elapsed time past which lines stop doubling.

The longest wait between two lines of one loop, and the elapsed time past which
lines stop doubling.
sourceraw docstring

on-progressclj

(on-progress r)

An :on-progress callback for a forward-chaining run (chain/chain) that counts the loop r reports up to the run's :derived total.

An `:on-progress` callback for a forward-chaining run (`chain/chain`) that counts the
loop `r` reports up to the run's `:derived` total.
sourceraw docstring

startclj

(start id label total)
(start id label total {:keys [clock] :as opts})

A reporter for a loop over total items (nil when unknown), its lines logged under the keyword id and opening with label. The clock starts here. Closing it (with-open) logs the closing line (done!), and a reporter left open logs on. opts: :clock, a zero-argument fn answering nanoseconds (System/nanoTime by default), and :timer?, whether a timer logs the lines no tick does (by default only under the default clock). The timer logs under the dynamic bindings in force here, so a caller's binding of trove/*log-fn* sees its lines.

A reporter for a loop over `total` items (nil when unknown), its lines logged under
the keyword `id` and opening with `label`.  The clock starts here.  Closing it
(`with-open`) logs the closing line (`done!`), and a reporter left open logs on.
`opts`: `:clock`, a zero-argument fn answering nanoseconds (`System/nanoTime` by
default), and `:timer?`, whether a timer logs the lines no tick does (by default only
under the default clock).  The timer logs under the dynamic bindings in force here, so
a caller's `binding` of `trove/*log-fn*` sees its lines.
sourceraw docstring

tick!clj

(tick! r)
(tick! r n)

Count n items (one by default) done in the loop r reports, and log a line when one is due. Safe from several threads.

Count `n` items (one by default) done in the loop `r` reports, and log a line when one
is due.  Safe from several threads.
sourceraw docstring

tick-to!clj

(tick-to! r n)

Count the loop r reports up to n items done, for a caller that reads a running total rather than counting each item. A total at or below the count already reached counts nothing.

Count the loop `r` reports up to `n` items done, for a caller that reads a running
total rather than counting each item.  A total at or below the count already reached
counts nothing.
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