Liking cljdoc? Tell your friends :D

sturdy.bulkhead


default-reject-handlerclj

(default-reject-handler request)
source

default-timeout-handlerclj

(default-timeout-handler request)
source

start-pool!clj

(start-pool!)
(start-pool! {:keys [num-workers queue-size]
              :or {num-workers
                     (max 1 (dec (.availableProcessors (Runtime/getRuntime))))
                   queue-size 10}})

Starts a new worker pool for processing compute-bound requests. Opts:

  • :num-workers (default: cores - 1, or 1)
  • :queue-size (default: 10)

Returns a pool object (a map) which can be passed to wrap-compute-bound or stop-pool!.

Starts a new worker pool for processing compute-bound requests.
Opts:
- :num-workers (default: cores - 1, or 1)
- :queue-size (default: 10)

Returns a pool object (a map) which can be passed to `wrap-compute-bound`
or `stop-pool!`.
sourceraw docstring

stop-pool!clj

(stop-pool! pool)

Stops the worker pool.

Stops the worker pool.
sourceraw docstring

worker-loopclj

(worker-loop job-chan pool-stats stop-chan)
source

wrap-compute-boundclj

(wrap-compute-bound handler pool)
(wrap-compute-bound handler
                    pool
                    {:keys [timeout-ms on-reject on-timeout]
                     :or {timeout-ms 30000
                          on-reject default-reject-handler
                          on-timeout default-timeout-handler}})

Ring middleware that limits concurrent compute-intensive requests by queueing them to a worker pool.

Accepts a pool created by start-pool! and opts:

  • :timeout-ms (default: 30000)
  • :on-reject (fn [request] -> response, called when queue is full)
  • :on-timeout (fn [request] -> response, called when queue timeout happens)
Ring middleware that limits concurrent compute-intensive requests
by queueing them to a worker pool.

Accepts a `pool` created by `start-pool!` and `opts`:
- :timeout-ms (default: 30000)
- :on-reject (fn [request] -> response, called when queue is full)
- :on-timeout (fn [request] -> response, called when queue timeout happens)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close