clojure - Clojure 中的 Actor

标签 clojure actor

我正在 Scala 中编写一个实用程序,其中包含一个“文件复制”参与者。我发送要复制的文件名, Actor 一次复制一个。

我如何使用代理在 Clojure 中做同样的事情?

最佳答案

为什么需要使用代理来执行此操作?因为你想异步复制它们?但如果你仍然想这样做,你可以使用类似的东西:

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

不过,也许使用 future 更好?

关于clojure - Clojure 中的 Actor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4680996/

相关文章:

apache-camel - Akka 本身支持集成模式吗?

scala - 跟踪 Scala actors 中的 "sender hierarchy"

algorithm - 如何在 Clojure 算法实现中处理多个变量?

clojure - 为什么 Aleph 的 HTTP 服务器不执行任何操作?

java - 如何从任何地方启动 Clojure REPL?

clojure - lein 导致 jline3 终端变得愚蠢

Clojure 序列和集合

scala - Akka 2 中调度程序的区别和使用模式有哪些?

scala - Akka 中的 `self` 是什么?

scala - 什么时候 Actor 不合适?