Actors in Clojure

I am writing a utility in Scala that includes the actor “copy file”. I send the names of the files to be copied, and the actor makes them one at a time.

How do I do the same in Clojure using agents?

+5
source share
1 answer

Why do you need to do this with agents? because you want to copy them asynchronously? But if you still want to do this, you can use something like:

(do-all (for [x file-names] (send-off agent-name copy-function x)))

although it might be better to use futures?

+2
source

All Articles