(execute-pool)
(executor)
(fixed-thread-executor num-threads)
(fixed-thread-executor num-threads options)
Returns an executor which has a fixed number of threads.
Returns an executor which has a fixed number of threads.
(instrumented-executor {:keys [thread-factory queue-length stats-callback
sample-period control-period controller metrics
initial-thread-count onto?]
:or {initial-thread-count 1
sample-period 25
control-period 10000
metrics (EnumSet/allOf Stats$Metric)
onto? true}})
Returns a java.util.concurrent.ExecutorService
, using Dirigiste.
|:---|:----
| thread-factory
| an optional java.util.concurrent.ThreadFactory
that creates the executor's threads. |
| queue-length
| the maximum number of pending tasks before .execute()
begins throwing java.util.concurrent.RejectedExecutionException
, defaults to 0
.
| stats-callback
| a function that will be invoked every control-period
with the relevant statistics for the executor.
| sample-period
| the interval, in milliseconds, between sampling the state of the executor for resizing and gathering statistics, defaults to 25
.
| control-period
| the interval, in milliseconds, between use of the controller to adjust the size of the executor, defaults to 10000
.
| controller
| the Dirigiste controller that is used to guide the pool's size.
| metrics
| an EnumSet
of the metrics that should be gathered for the controller, defaults to all.
| initial-thread-count
| the number of threads that the pool should begin with.
| onto?
| if true, all streams and deferred generated in the scope of this executor will also be 'on' this executor.
Returns a `java.util.concurrent.ExecutorService`, using [Dirigiste](https://github.com/ztellman/dirigiste). |:---|:---- | `thread-factory` | an optional `java.util.concurrent.ThreadFactory` that creates the executor's threads. | | `queue-length` | the maximum number of pending tasks before `.execute()` begins throwing `java.util.concurrent.RejectedExecutionException`, defaults to `0`. | `stats-callback` | a function that will be invoked every `control-period` with the relevant statistics for the executor. | `sample-period` | the interval, in milliseconds, between sampling the state of the executor for resizing and gathering statistics, defaults to `25`. | `control-period` | the interval, in milliseconds, between use of the controller to adjust the size of the executor, defaults to `10000`. | `controller` | the Dirigiste controller that is used to guide the pool's size. | `metrics` | an `EnumSet` of the metrics that should be gathered for the controller, defaults to all. | `initial-thread-count` | the number of threads that the pool should begin with. | `onto?` | if true, all streams and deferred generated in the scope of this executor will also be 'on' this executor.
(register-execute-pool-stats-callback c)
Registers a callback which will be called with execute-pool stats.
Registers a callback which will be called with execute-pool stats.
(register-wait-pool-stats-callback c)
Registers a callback which will be called with wait-pool stats.
Registers a callback which will be called with wait-pool stats.
(stats->map s)
(stats->map s quantiles)
Converts a Dirigiste Stats
object into a map of values onto quantiles.
Converts a Dirigiste `Stats` object into a map of values onto quantiles.
(thread-factory name-generator executor-promise)
(thread-factory name-generator executor-promise stack-size)
(thread-factory name-generator executor-promise stack-size daemon?)
(thread-factory name-generator
executor-promise
stack-size
daemon?
new-thread-fn)
Returns a java.util.concurrent.ThreadFactory
.
|:---|:----
| name-generator
| a zero-argument function, which, when invoked returns the name of the java.lang.Thread
that will be created. |
| executor-promise
| a promise eventually containing a java.util.concurrent.Executor
that will be stored on manifold.executor/executor-thread-local
. |
| stack-size
| the desired stack size for the new thread, or nil/zero to indicate that this parameter is to be ignored. |
| daemon?
| marks the created threads as either daemon or user threads. The Java Virtual Machine exits when the only threads running are all daemon threads. |
| new-thread-fn
| a four arguments function which returns an implementation of java.lang.Thread
when called. |
Returns a `java.util.concurrent.ThreadFactory`. |:---|:---- | `name-generator` | a zero-argument function, which, when invoked returns the name of the `java.lang.Thread` that will be created. | | `executor-promise` | a promise eventually containing a `java.util.concurrent.Executor` that will be stored on `manifold.executor/executor-thread-local`. | | `stack-size` | the desired stack size for the new thread, or nil/zero to indicate that this parameter is to be ignored. | | `daemon?` | marks the created threads as either daemon or user threads. The Java Virtual Machine exits when the only threads running are all daemon threads. | | `new-thread-fn` | a four arguments function which returns an implementation of `java.lang.Thread` when called. |
(unregister-execute-pool-stats-callback c)
Unregisters a previous execute-pool stats callback.
Unregisters a previous execute-pool stats callback.
(unregister-wait-pool-stats-callback c)
Unregisters a previous wait-pool stats callback.
Unregisters a previous wait-pool stats callback.
(utilization-executor utilization)
(utilization-executor utilization max-threads)
(utilization-executor utilization max-threads options)
Returns an executor which sizes the thread pool according to target utilization, within
[0,1]
, up to max-threads
. The queue-length
for this executor is always 0
, and by
default has an unbounded number of threads.
Returns an executor which sizes the thread pool according to target utilization, within `[0,1]`, up to `max-threads`. The `queue-length` for this executor is always `0`, and by default has an unbounded number of threads.
(wait-pool)
(with-executor executor & body)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close