3 ms·
I believe all I/O is blocking unless you use something that wraps NIO. This is definitely true for core.async threads, but I'm not sure why it would any differe
by lastofus 8y ago
I believe all I/O is blocking unless you use something that wraps NIO. This is definitely true for core.async threads, but I'm not sure why it would any different for agents.
This is also a bit of a departure for people coming from Go or Erlang/Elixir.
- tombert 8y agoAgents are run in a separate pool, and no one agent is processing at a time, so I suppose they're not "parallel", but concurrent still. I think the agents are preemptive, but I'm not 100% sure on that.
- lastofus 8y agoI found this comment enlightening: https://clojuredocs.org/clojure.core/send-off#example-59347211e4b06e730307db22 https://clojuredocs.org/clojure.core/send-off#example-593472... It seems like there are a lot of parallels between agents and core.async. Agents, like go blocks, run in a thread pool. Any blocking IO should be pushed off to a separate thread outside of the thread pool. In the case of agents, there is (send-off). In the case of core.async, there is (thread)