Thank you, Stuart. This is a useful rule that I'll try to remember: "Clojure makes it easier to write programs which manage their state correctly. Hystrix makes it easier to write programs which manage side-effect-heavy libraries correctly."
On Friday, July 24, 2015 at 2:36:28 PM UTC-4, Stuart Sierra wrote: > > Hi Lawrence, > > I think Clojure's concurrency primitives are more narrowly scoped than > that. > > Clojure's most significant concurrency features (Atoms, Refs, Vars, > Agents) are mostly about managing changes to *shared, mutable state* via > pure functions. Hystrix is about managing code with unpredictable behavior > and timing, e.g. client libraries which do blocking I/O and other side > effects. > > When I do presentations or workshops about Clojure, I always make a point > to say that Clojure does not try to solve **all** problems related to > concurrency and parallelism. You still need things like Java thread pools. > Clojure was designed as a hosted language precisely so that it can take > advantage of the rich set of concurrency tools available on the JVM > platform, including frameworks like Hystrix. > > Clojure makes it easier to write programs which manage their state > correctly. Hystrix makes it easier to write programs which manage > side-effect-heavy libraries correctly. Together, they make a pretty good > combination. > > –S > > > On Friday, July 24, 2015 at 1:10:10 PM UTC-4, Lawrence Krubner wrote: >> >> I find this very interesting: >> >> http://blog.josephwilk.net/clojure/building-clojure-services-at-scale.html >> >> "[Using Hystrix comes at a cost:] We cannot use Clojure’s concurrency >> primitives (futures/promises/agents)." >> >> That is fascinating to think that at some point Clojure's concurrency >> primitives are not enough, and so we need to give up on them and move to a >> Java library. I am aware that Netflix is dealing with unusual scale, but >> what is the point of Clojure if it doesn't automate exactly these issues? I >> don't mean this as an attack on Clojure, but rather, I'm curious why issues >> of thread pool management and circuit breakers don't get baked in to a >> deeper level of Clojure? After all, that is the reason why people use >> Clojure, yes? The argument for Clojure is exactly that it automates so much >> of the work of dealing with concurrency, right? >> >> Am I being stupid? >> >> >> >> >> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.