agam
agam

Reputation: 5394

Clojure equivalent of "Actors"

I've been looking into Elixir and Akka recently, and that got me thinking: what's the equivalent in Clojure?

(I am aware that it's possible that I'm "asking the wrong question here", hopefully this isn't too open ended)

Upvotes: 4

Views: 3321

Answers (1)

andy_fingerhut
andy_fingerhut

Reputation: 1516

Rich Hickey in his 2008 talk "Clojure Concurrency" explicitly distinguishes agents from actors, mentioning several ways that they are different from each other. Search for "agent" and "actor" in the transcript of this talk if you want to find some of those comments quickly: https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ClojureConcurrency.md

More here on clojure.org on the differences between agents and actors: https://clojure.org/about/state#actors

Another conversation from someone that knows more about the original Hewitt actor model than I do, apparently, that may be useful to read: http://www.dalnefre.com/wp/2010/06/actors-in-clojure-why-not/

My understanding is that if you want Erlang-style actors, you basically need unreliable message queues between threads/processes. Between different processes, there are any number of ways to get unreliable message passing, none built into Clojure, but all available via Java interop.

Upvotes: 12

Related Questions