开发者

Actors in Clojure

I am writing a utility in开发者_StackOverflow中文版 Scala that includes a "file copy" actor. I send file names to be copied and the actor does them one at a time.

How would I to do the same thing in Clojure using agents?


Why you need to perform this using 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, maybe it's better to use futures?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜