send-off

send-off is the other function that we can use to update agents:

(send-off play-time - 1)

In the preceding example, we have subtracted 1 using Clojure's function - . The - function uses current value of play-time to subtract 1 that we passed as an argument to send-off.

We can check the current value of play-time:

@play-time

Dereferencing agent gives us an updated state, as follows:

=> 1

We used the send-off function in the same manner that we used send. The difference between them is that send-off uses a different thread pool than the one used by send. The send-off thread pool can also grow in size.