thread-pool/scope
src/thread-pool/scope.tur
the `with-pool` scope macro (SCOPE-V0).
Since: TP2
defmacro
with-pool
(with-pool [binding & body])
run `body` with a linear pool bound to `name`, stopping it on
Parameters
| binding | a 2-vector [name init], where init evaluates to a (Pool T). | |
| body | one or more expressions; the last expression's value is the | |
| value of the whole with-pool form. |
Example
(with-pool [p (pool-new 8 worker)]
(pool-submit p 1)
(pool-submit p 2)) ;; pool-stop p runs here automatically
Since: TP2