promesa.exec

Executors & Schedulers facilities.

cached-pool

(cached-pool)(cached-pool opts)

A cached thread pool constructor.

counted-thread-factory

(counted-thread-factory name daemon)

current-thread-executor

default-executor

default-scheduler

fixed-pool

(fixed-pool n)(fixed-pool n opts)

A fixed thread pool constructor.

forkjoin-named-thread-factory

(forkjoin-named-thread-factory name)

forkjoin-pool

(forkjoin-pool {:keys [factory async? parallelism], :or {async? true}, :as opts})

processors

resolve-executor

(resolve-executor)(resolve-executor executor)

resolve-scheduler

(resolve-scheduler)(resolve-scheduler scheduler)

run!

(run! task)(run! executor task)

Run the task in the provided executor.

schedule!

(schedule! ms task)(schedule! scheduler ms task)

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-pool

(scheduled-pool)(scheduled-pool n)(scheduled-pool n opts)

A scheduled thread pool constructor.

single-pool

(single-pool)(single-pool opts)

A single thread pool constructor.

submit!

(submit! task)(submit! executor task)

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.

work-stealing-pool

(work-stealing-pool)(work-stealing-pool n)

Creates a work-stealing thread pool.