Liking cljdoc? Tell your friends :D

com.climate.claypoole

Threadpool tools for Clojure. Claypoole provides parallel functions and macros that use threads from a pool and otherwise act like key builtins like future, pmap, for, and so on. See the file README.md for an introduction.

A threadpool is just an ExecutorService with a fixed number of threads. In general, you can use your own ExecutorService in place of any threadpool, and you can treat a threadpool as you would any other ExecutorService.

Threadpool tools for Clojure. Claypoole provides parallel functions and
macros that use threads from a pool and otherwise act like key builtins like
future, pmap, for, and so on. See the file README.md for an introduction.

A threadpool is just an ExecutorService with a fixed number of threads. In
general, you can use your own ExecutorService in place of any threadpool, and
you can treat a threadpool as you would any other ExecutorService.
raw docstring

com.climate.claypoole.lazy

Lazy threadpool tools for Clojure.

This namespace provides lazy versions of the parallel functions from com.climate.claypoole. They will only run the outputs you realize, plus a few more (a buffer), just like core pmap. The buffer is used to help keep the threadpool busy.

Each parallel function also comes with a -buffer variant that allows you to specify the buffer size. The non -buffer forms use the threadpool size as their buffer size.

To use the threadpool most efficiently with these lazy functions, prefer the unordered versions (e.g. upmap), since the ordered ones may starve the threadpool of work. For instance, this pmap will take 6 milliseconds to run: (lazy/pmap 2 #(Thread/sleep %) [4 3 2 1]) That's because it will not realize the 2 task until the 4 task is complete, so one thread in the pool will sit idle for 1 millisecond.

Lazy threadpool tools for Clojure.

This namespace provides lazy versions of the parallel functions from
com.climate.claypoole. They will only run the outputs you realize, plus a few
more (a buffer), just like core pmap. The buffer is used to help keep the
threadpool busy.

Each parallel function also comes with a -buffer variant that allows you to
specify the buffer size. The non -buffer forms use the threadpool size as
their buffer size.

To use the threadpool most efficiently with these lazy functions, prefer the
unordered versions (e.g. upmap), since the ordered ones may starve the
threadpool of work. For instance, this pmap will take 6 milliseconds to run:
  (lazy/pmap 2 #(Thread/sleep %) [4 3 2 1])
That's because it will not realize the 2 task until the 4 task is complete,
so one thread in the pool will sit idle for 1 millisecond.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close