lamina.executor documentation

bound-task

macro

[& body]

Executes the body on a separate thread, returning an unrealized result representing the eventual value or error. Unlike task, thread-local bindings are preserved when evaluating the body.

default-executor

var

A default executor with an unbounded maximum thread count.

defer

fn

[ch]
[executor ch]

Defers propagation of messages onto another thread pool. This may change the downstream order of messages.

executor

fn

[{:keys [idle-timeout adjust-interval min-thread-count max-thread-count interrupt?], :or {idle-timeout 60000, adjust-interval 1000, interrupt? false}, :as options}]

Defines a thread pool that can be used with instrument and defn-instrumented.

more goes here

executor-channel

fn

[{:keys [name executor probes], :as options}]

Creates a channel that ensures all downstream channels will receive messages on the thread-pool specified by :executor. This can be useful for both rate-limiting and parallelization.

This may change the downstream order of messages.

pmap*

fn

[f ch]
[{:keys [executor name], :as options, :or {executor default-executor, name "pmap*"}} f ch]

Like map*, but executes function on thread pool. This preserves the downstream order of messages.

shutdown

fn

[_]

Shuts down the thread pool, making it impossible for any further tasks to be enqueued.

task

macro

[& body]

Executes the body on a separate thread, returning an unrealized result representing the eventual value or error.