What is the difference between Clojure's "send" and "send-off" functions with respect to dispatching an action to an agent?

Viewed 3272

The Clojure API describes these two functions as:

(send a f & args) - Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)

and

(send-off a f & args) - Dispatch a potentially blocking action to an agent. Returns the agent immediately. Subsequently, in a separate thread, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)

The only obvious difference is send-off should be used when an action may block. Can somebody explain this difference in functionality in greater detail?

1 Answers
Related