What matters is the I/O framework. You'll want to use a non-blocking
network library, then you should be able to use `send` rather than
`send-off`. `send` uses a fixed-size thread pool for all Agents in the
system.
That said, while I believe Agents are a suitable solution to this problem,
Hi all,
I'm writing a c10k-style service, i.e. suppose 10,000 concurrent
connections, mostly IO-bound. Clojure agents with `send-off` are
fantastically close to what I want conceptually, but I'm curious about the
implementation details--can anyone confirm, this would end up forking
10,000
send-off works by submitting a Runnable to a newCachedThreadPool.
http://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure
A Runnable sent to a thread pool will have exclusive use of that
thread until it completes; therefore, greater concurrency can only be
achieved by
Hi
I would only add, that with Clojure 1.5 you can supply your own Executor
using (send-via ), the default threadpools are not hard-wired anymore.
See
https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef#src/jvm/clojure/lang/Agent.javafor
further details.
Las
On