Executors & Schedulers facilities.
Executors & Schedulers facilities.
(cached-executor & {:keys [factory]})
A cached thread executor pool constructor.
A cached thread executor pool constructor.
(cached-pool)
(cached-pool opts)
A cached thread pool constructor.
A cached thread pool constructor.
A global, default executor service.
A global, default executor service.
(default-forkjoin-thread-factory &
{:keys [name daemon]
:or {name "promesa/forkjoin/%s" daemon true}})
A global, default scheduler executor service.
A global, default scheduler executor service.
(default-thread-factory
&
{:keys [name daemon priority]
:or {daemon true priority Thread/NORM_PRIORITY name "promesa/thread/%s"}})
(fixed-executor & {:keys [parallelism factory]})
A fixed thread executor pool constructor.
A fixed thread executor pool constructor.
(fixed-pool n)
(fixed-pool n opts)
A fixed thread pool constructor.
A fixed thread pool constructor.
(forkjoin-executor & {:keys [factory async? parallelism] :or {async? true}})
(forkjoin-pool {:keys [factory async? parallelism] :or {async? true} :as opts})
(pmap f coll)
(pmap f coll & colls)
Analogous to the clojure.core/pmap
with the excetion that it allows
use a custom executor (binded to default-executor var) The default
clojure chunk size (32) is used for evaluation and the real
parallelism is determined by the provided executor.
EXPERIMENTAL API: This function should be considered EXPERIMENTAL and may be changed or removed in future versions until this notification is removed.
Analogous to the `clojure.core/pmap` with the excetion that it allows use a custom executor (binded to *default-executor* var) The default clojure chunk size (32) is used for evaluation and the real parallelism is determined by the provided executor. EXPERIMENTAL API: This function should be considered EXPERIMENTAL and may be changed or removed in future versions until this notification is removed.
(run! f)
(run! executor f)
Run the task in the provided executor.
Run the task in the provided executor.
A global thread executor that uses the same thread to run the code.
A global thread executor that uses the same thread to run the code.
(schedule! ms f)
(schedule! scheduler ms f)
Schedule a callable to be executed after the ms
delay
is reached.
In JVM it uses a scheduled executor service and in JS
it uses the setTimeout
function.
Schedule a callable to be executed after the `ms` delay is reached. In JVM it uses a scheduled executor service and in JS it uses the `setTimeout` function.
(scheduled-executor & {:keys [parallelism factory] :or {parallelism 1}})
A scheduled thread pool constructor.
A scheduled thread pool constructor.
(scheduled-pool)
(scheduled-pool n)
(scheduled-pool n opts)
A scheduled thread pool constructor.
A scheduled thread pool constructor.
(shutdown! executor)
Shutdowns the executor service.
Shutdowns the executor service.
(shutdown-now! executor)
Shutdowns and interrupts the executor service.
Shutdowns and interrupts the executor service.
(single-executor & {:keys [factory]})
A single thread executor pool constructor.
A single thread executor pool constructor.
(single-pool)
(single-pool opts)
A single thread pool constructor.
A single thread pool constructor.
(submit! f)
(submit! executor f)
Submit a task to be executed in a provided executor and return a promise that will be completed with the return value of a task.
A task is a plain clojure function.
Submit a task to be executed in a provided executor and return a promise that will be completed with the return value of a task. A task is a plain clojure function.
A global, thread per task executor service.
A global, thread per task executor service.
A global, virtual thread per task executor service.
A global, virtual thread per task executor service.
(with-dispatch executor & body)
Helper macro for dispatch execution of the body to an executor service. The returned promise is not cancellable (the body will be executed independently of the cancellation).
Helper macro for dispatch execution of the body to an executor service. The returned promise is not cancellable (the body will be executed independently of the cancellation).
(with-executor executor & body)
Binds the default-executor var with the provided executor,
executes the macro body. It also can optionally shutdown or shutdown
and interrupt on termination if you provide ^:shutdown
and
^:interrupt
metadata.
EXPERIMENTAL API: This function should be considered EXPERIMENTAL and may be changed or removed in future versions until this notification is removed.
Binds the *default-executor* var with the provided executor, executes the macro body. It also can optionally shutdown or shutdown and interrupt on termination if you provide `^:shutdown` and `^:interrupt` metadata. EXPERIMENTAL API: This function should be considered EXPERIMENTAL and may be changed or removed in future versions until this notification is removed.
(work-stealing-executor & params)
An alias for the forkjoin-executor
.
An alias for the `forkjoin-executor`.
(work-stealing-pool)
(work-stealing-pool n)
Creates a work-stealing thread pool.
Creates a work-stealing thread pool.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close