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.
(concurrency-limiter
&
{:keys [executor concurrency queue]
:or {executor *default-executor* concurrency 1 queue Integer/MAX_VALUE}})
Create an instance of concurrencly limiter. EXPERIMENTAL
Create an instance of concurrencly limiter. EXPERIMENTAL
(default-forkjoin-thread-factory &
{:keys [name daemon]
:or {name "promesa/forkjoin/%s" daemon true}})
(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})
(run! f)
(run! executor f)
Run the task in the provided executor.
Run the task in the provided executor.
(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.
(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.
(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).
(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