Only applies when:
If you have unrealized lazy sequence as input
and/or
If you have async run-fn
The batcher will either issue a batch of wait for more input or futures finishing. For efficiency, it's recommended that your input to batcher is a vector, list or realized sequence.
Here's the tuning knobs for the mechanism of premature partial batches.
Strategy can be a map with these options:
After this many ms have elapsed since last batch, the batcher will start considering premature partial batch, starting with batches that are slightly less than full, then ramping up as time goes by. Default 30ms.
After this many ms have elapsed since last batch, the requirement for issuing premature partial batch will be
at the lowest, as specified by :min-items-ratio
. Default 100ms.
The lowest bound for premature batch, default is 0.3
, requiring the batch to be at least 30% full to be
prematurely issued.
Instead of map of settings you can just use nil or a short-hand for a preset:
min-items-ratio
to 1
, disallowing premature batchesBatcher will never issue a partial batch is it thinks that run-fn
has no more concurrency capacity:
p/async-fn
helper, then the concurrency limit is automatically observed(p/paginate! [run-fn {:concurrency 5} input])
run-fn
has more capacity, and this mechanism won't stop partial batchesCan you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close