(cancel-scheduled tt)
(cancel-scheduled handle)
Cancel a scheduled task.
Cancel a scheduled task.
(error? x)
Dialect-independent error check predicate. Checks for exceptions, errors, throwables, ex-info, etc. Whatever makes sense to be considered as, and handled as, an error for the host language.
Dialect-independent error check predicate. Checks for exceptions, errors, throwables, ex-info, etc. Whatever makes sense to be considered as, and handled as, an error for the host language.
(gather form pred & {:keys [select] :or {select identity}})
Recursively looks through a form for items for which
pred
is truthy. Returns a vector of all such items.
If select
is given, then for each form/subform it'll
be called to choose the parts of the form that should
be scanned. It receives the form, and should return
the thing that should be scanned.
Recursively looks through a form for items for which `pred` is truthy. Returns a vector of all such items. If `select` is given, then for each form/subform it'll be called to choose the parts of the form that should be scanned. It receives the form, and should return the thing that should be scanned.
(schedule-every delay f & args)
Dialect-independent function to schedule periodic task. Schedules
f
to be invoked with args
every delay
milliseconds.
Returns a handle that can be passed to cancel-scheduled
to
cancel it.
Dialect-independent function to schedule periodic task. Schedules `f` to be invoked with `args` every `delay` milliseconds. Returns a handle that can be passed to `cancel-scheduled` to cancel it.
(schedule-once delay f & args)
Dialect-independent task scheduler. Schedules f
to be invoked
with args
, after delay
millseconds.
Returns a handle that can be passed to cancel-scheduled
to cancel
the task.
Dialect-independent task scheduler. Schedules `f` to be invoked with `args`, after `delay` millseconds. Returns a handle that can be passed to `cancel-scheduled` to cancel the task.
(sig-listen sig f)
(sig-listen sig k f)
Attach a listener to sig
, a signal. k
is a key
that can be used to remove the listener via sig-unlisten
;
if omitted then f
doubles as the key.
f
is the callback to be invoked when the signal is called.
Attach a listener to `sig`, a signal. `k` is a key that can be used to remove the listener via `sig-unlisten`; if omitted then `f` doubles as the key. `f` is the callback to be invoked when the signal is called.
(sig-unlisten sig k)
Removes a signal listener with the key k
.
Removes a signal listener with the key `k`.
(signal)
Creates a signal, which is a callable that, when called,
invokes all listener callbacks attached to it. Listeners
can be registered with sig-listen
and sig-unlisten
.
Creates a signal, which is a callable that, when called, invokes all listener callbacks attached to it. Listeners can be registered with `sig-listen` and `sig-unlisten`.
(signal? x)
Returns true if x
is a signal.
Returns true if `x` is a signal.
(ticker delay)
Creates a signal and schedules it to be called every delay
milliseconds. Returns a tuple [sig scheduled]
, where sig
is the signal, and scheduled
is a handle that can be passed
to cancel-scheduled
to cancel the periodic calls.
Creates a signal and schedules it to be called every `delay` milliseconds. Returns a tuple `[sig scheduled]`, where `sig` is the signal, and `scheduled` is a handle that can be passed to `cancel-scheduled` to cancel the periodic calls.
(try-fn f & {catch-fn :catch finally-fn :finally})
Dialect independent version of try with catch-anything.
Dialect independent version of try with catch-anything.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close