liveBook · Manning

Send-off

As explained in Clojure: The Essential Reference

send-off is a Clojure function that asynchronously dispatches an action function to an agent for execution on the unbounded agent send-off pool.

send-off asynchronously dispatches an action function to an agent for execution on the unbounded agent send-off pool. It suits slow or potentially blocking work while preserving the agent’s sequential action processing. section 14.6

Use send-off when an agent action may keep a thread busy:

  • Observe the resulting state with deref or wait for completion with await. section 14.6

How Clojure: The Essential Reference covers it

How deep it goes
Defines asynchronous dispatch and demonstrates recurring actions, but does not detail the pool’s implementation.
Examples
Uses a sleeping network monitor that reschedules itself, reports failures, and stops through a kill flag.
What it assumes
Assumes familiarity with Clojure functions, agents, asynchronous execution, and dereferencing agent state.
What you can do after
Operate agents with recurring or slow actions while observing state and handling action failures.
How it connects
Connects agents with asynchronous state changes, await, send, send-via, and agent error handling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Clojure: The Essential Reference. The section links point to the parts of the book it draws on.