(execute executor f)
Submits the fn to specified executor, returns a Future
Submits the fn to specified executor, returns a Future
(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 executor & 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 executor f)
Takes an executor instance and 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.
Takes an executor instance and 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.
(schedule
type
delay
f
&
{:keys [executor initial-delay unit]
:or {executor (knit.core/executor :scheduled) initial-delay 0 unit :ms}})
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-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