(execute executor f)
Submits the fn to specified executor, returns a Future
Submits the fn to specified executor, returns a Future
(executor type)
(executor type
{:keys [thread-factory num-threads]
:or {num-threads (int 1)
thread-factory (Executors/defaultThreadFactory)}})
Returns ExecutorService.
type
can be :single, :cached, :fixed or :scheduled, this matches the
corresponding Java instances
Returns ExecutorService. `type` can be :single, :cached, :fixed or :scheduled, this matches the corresponding Java instances
(future options & body)
Takes an executor instance and a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used..
Takes an executor instance and a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used..
(future-call f)
(future-call f
{:as options
:keys [executor preserve-bindings?]
:or {preserve-bindings? true
executor clojure.lang.Agent/soloExecutor}})
Takes a function of no args and yields a future object that will invoke the function in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?.
Takes a function of no args and yields a future object that will invoke the function in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?.
(schedule type delay f)
(schedule type
delay
f
{:keys [executor initial-delay unit]
:or {initial-delay 0 unit :milliseconds}})
Return a ScheduledFuture.
type
can be :with-fixed-delay, :at-fixed-rate, :once
delay
's default unit is milliseconds
f
task (function) to be run
Return a ScheduledFuture. `type` can be :with-fixed-delay, :at-fixed-rate, :once `delay`'s default unit is milliseconds `f` task (function) to be run
(thread opts & body)
Same as thread but takes an option map first: :executor - An executor that implements clojure.core.async.impl.protocols/Executor
Same as thread but takes an option map first: :executor - An executor that implements clojure.core.async.impl.protocols/Executor
(thread-call f)
(thread-call f {:keys [executor]})
Executes f in another thread, returning immediately to the calling thread. An optional second argument allows to pass an executor that implements clojure.core.async.impl.protocols/Executor. Returns a channel which will receive the result of calling f when completed.
Executes f in another thread, returning immediately to the calling thread. An optional second argument allows to pass an executor that implements clojure.core.async.impl.protocols/Executor. Returns a channel which will receive the result of calling f when completed.
(thread-factory {:keys [daemon thread-group] :or {daemon true}})
Returns a new ThreadFactory instance
Returns a new ThreadFactory instance
(thread-group name)
(thread-group parent name)
Returns a new ThreadGroup instance to be used in thread-factory
Returns a new ThreadGroup instance to be used in thread-factory
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close