This namespace contains helper functions to perform process-related actions (like sending a message, or exit signal) with a delay.
Warning! The functions in this namespace use
core.async
's timer internally. As of now the resolution of the timer is 10 ms. Which only says when the operation, waiting for the timeout, will be queued for execution. The actual execution begins even later.
This namespace contains helper functions to perform process-related actions (like sending a message, or exit signal) with a delay. >**Warning!** The functions in this namespace use `core.async`'s >timer internally. As of now the resolution of the timer is 10 ms. >Which only says when the operation, waiting for the timeout, >will be _queued_ for execution. The actual execution begins >even later.
(apply-after msecs f)
(apply-after msecs f args)
Applies f
to args
after msecs
.
Returns the timer reference.
Throws on bad arguments.
Applies `f` to `args` after `msecs`. Returns the timer reference. Throws on bad arguments.
(apply-interval msecs f)
(apply-interval msecs f args)
Evaluates (! pid message)
repeatedly at intervals of msecs
.
Returns the timer reference.
Throws on bad arguments.
Evaluates `(! pid message)` repeatedly at intervals of `msecs`. Returns the timer reference. Throws on bad arguments.
(cancel tref)
Cancels a previously requested timeout. tref
is a unique timer
reference returned by the related timer function.
Throws if tref
is not a timer reference.
Cancels a previously requested timeout. `tref` is a unique timer reference returned by the related timer function. Throws if `tref` is not a timer reference.
(exit-after msecs reason)
(exit-after msecs pid reason)
Sends an exit signal with reason reason
to pid pid
after msecs
.
pid
can be a pid or a registered name.
Returns the timer reference.
Throws on bad arguments.
Sends an exit signal with reason `reason` to pid `pid` after `msecs`. `pid` can be a pid or a registered name. Returns the timer reference. Throws on bad arguments.
(kill-after msecs)
(kill-after msecs pid)
The same as exit-after
called with reason :kill
.
The same as `exit-after` called with reason `:kill`.
(send-after msecs message)
(send-after msecs pid message)
Evaluates (! pid message)
after msecs
.
Returns the timer reference.
Throws on bad arguments.
Evaluates `(! pid message)` after `msecs`. Returns the timer reference. Throws on bad arguments.
(send-interval msecs message)
(send-interval msecs pid message)
Evaluates (! pid message)
repeatedly at intervals of msecs
.
Returns the timer reference.
Throws on bad arguments.
Evaluates `(! pid message)` repeatedly at intervals of `msecs`. Returns the timer reference. Throws on bad arguments.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close