Indeterminate progress indicator (aka a "spinner"), for the case where the progress of a long-running task cannot be determined.
Indeterminate progress indicator (aka a "spinner"), for the case where the progress of a long-running task cannot be determined.
(active?)Is an indeterminate progress indicator active (currently running)?
Is an indeterminate progress indicator active (currently running)?
(animate! & body)Equivalent to clojure.core/do, but displays an indeterminate progress
indicator (aka 'spinner') while the forms are executing. If the first form is
the keyword :opts, the second form must be a map, containing any/all of
these keys:
:frames - the frames (a sequence of Strings) to use for the
indeterminate progress indicator (default is
(:ascii-spinner styles)):delay-in-ms - the delay (in ms) between frames (default is 100ms):fg-colour - the foregound colour of the indeterminate progress
indicator (default is :default) - see the jansi-clj
docs for allowed
values, and prefix with bright- to get the bright
equivalent:bg-colour - the background colour of the indeterminate progress
indicator (default is :default) - see the jansi-clj
docs for allowed
values, and prefix with bright- to get the bright
equivalent:attributes - the attributes of the indeterminate progress indicator
(default is [:default]) - see the jansi-clj
docs for
allowed values:space-after-indicator? - whether a single space character should be
printed after the indeterminate progress indicator. This
can be more visually appealing when using Unicode frames as
it creates some separation with the cursor.
(default is true)Notes:
Equivalent to `clojure.core/do`, but displays an indeterminate progress
indicator (aka 'spinner') while the forms are executing. If the first form is
the keyword `:opts`, the second form _must_ be a map, containing any/all of
these keys:
* `:frames` - the frames (a sequence of `String`s) to use for the
indeterminate progress indicator (default is
`(:ascii-spinner styles)`)
* `:delay-in-ms` - the delay (in ms) between frames (default is `100`ms)
* `:fg-colour` - the foregound colour of the indeterminate progress
indicator (default is `:default`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#colors) for allowed
values, and prefix with `bright-` to get the bright
equivalent
* `:bg-colour` - the background colour of the indeterminate progress
indicator (default is `:default`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#colors) for allowed
values, and prefix with `bright-` to get the bright
equivalent
* `:attributes` - the attributes of the indeterminate progress indicator
(default is `[:default]`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#attributes) for
allowed values
* `:space-after-indicator?` - whether a single space character should be
printed after the indeterminate progress indicator. This
can be more visually appealing when using Unicode frames as
it creates some separation with the cursor.
(default is `true`)
Notes:
* When the JVM's stdout stream doesn't support ANSI escape sequences (e.g.
when output is redirected to a file), the forms will be executed without any
animation occurring(animatef! f)(animatef! opts f)Starts the indeterminate progress indicator, calls fn f (a function of zero
parameters), then stops the progress indicator. Returns the result of f.
Note: the animate! macro is preferred over this function.
The optional opts map may have an/all of these keys:
:frames - the frames (a sequence of Strings) to use for the
indeterminate progress indicator (default is
(:ascii-spinner styles)):delay-in-ms - the delay (in ms) between frames (default is 100ms):fg-colour - the foregound colour of the indeterminate progress
indicator (default is :default) - see the jansi-clj
docs for allowed
values, and prefix with bright- to get the bright
equivalent:bg-colour - the background colour of the indeterminate progress
indicator (default is :default) - see the jansi-clj
docs for allowed
values, and prefix with bright- to get the bright
equivalent:attributes - the attributes of the indeterminate progress indicator
(default is [:default]) - see the jansi-clj
docs for
allowed values:space-after-indicator? - whether a single space character should be
printed after the indeterminate progress indicator. This
can be more visually appealing when using Unicode frames as
it creates some separation with the cursor.
(default is true)Notes:
f will be executed without any
animation occurringStarts the indeterminate progress indicator, calls fn `f` (a function of zero
parameters), then stops the progress indicator. Returns the result of `f`.
**Note: the [[animate!]] macro is preferred over this function.**
The optional `opts` map may have an/all of these keys:
* `:frames` - the frames (a sequence of `String`s) to use for the
indeterminate progress indicator (default is
`(:ascii-spinner styles)`)
* `:delay-in-ms` - the delay (in ms) between frames (default is `100`ms)
* `:fg-colour` - the foregound colour of the indeterminate progress
indicator (default is `:default`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#colors) for allowed
values, and prefix with `bright-` to get the bright
equivalent
* `:bg-colour` - the background colour of the indeterminate progress
indicator (default is `:default`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#colors) for allowed
values, and prefix with `bright-` to get the bright
equivalent
* `:attributes` - the attributes of the indeterminate progress indicator
(default is `[:default]`) - see [the `jansi-clj`
docs](https://github.com/xsc/jansi-clj#attributes) for
allowed values
* `:space-after-indicator?` - whether a single space character should be
printed after the indeterminate progress indicator. This
can be more visually appealing when using Unicode frames as
it creates some separation with the cursor.
(default is `true`)
Notes:
* When the JVM's stdout stream doesn't support ANSI escape sequences (e.g.
when output is redirected to a file), `f` will be executed without any
animation occurringThe default delay between frames (in milliseconds), if one isn't specified.
The default delay between frames (in milliseconds), if one isn't specified.
The default indeterminate progress indicator style used, if one isn't
specified, as a keyword that has an associated entry in [styles]. This style
is known to function on all platforms.
The default indeterminate progress indicator style used, if one isn't specified, as a `keyword` that has an associated entry in [styles]. This style is known to function on all platforms.
(print & more)Schedules the given values for printing, since clojure.core/print and related output fns interfere with an active indeterminate progress indicator.
Notes:
\n in the value(s)Schedules the given values for printing, since [clojure.core/print](https://clojuredocs.org/clojure.core/print) and related output fns interfere with an active indeterminate progress indicator. Notes: * output is emitted in between 'frames' of the progress indicator, so may not appear immediately * values are space delimited as in [clojure.core/print](https://clojuredocs.org/clojure.core/print) - use [clojure.core/str](https://clojuredocs.org/clojure.core/str), [clojure.core/format](https://clojuredocs.org/clojure.core/format), etc. for finer control * no newlines are inserted - if message(s) are to appear on new lines the caller needs to include `\n` in the value(s)
(state)What state is the indeterminate progress indicator currently in? One of:
:inactive:active:shutting-downWhat state is the indeterminate progress indicator currently in? One of: * `:inactive` * `:active` * `:shutting-down`
A selection of predefined styles of determinate progress indicators,
represented as a map. Only ASCII progress indicators are known to work
reliably - other styles depend on the operating system, terminal font &
encoding, phase of the moon, and how long since your dog last pooped.
A selection of predefined styles of determinate progress indicators, represented as a `map`. Only ASCII progress indicators are known to work reliably - other styles depend on the operating system, terminal font & encoding, phase of the moon, and how long since your dog last pooped.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |