Fork me on GitHub
#core-async
<
2021-12-09
>
leifericf08:12:05

Hi, everyone! I’m a Clojure newbie, who has recently stumbled upon https://clojure.org/news/2013/06/28/clojure-clore-async-channels. Brace yourself for a naive question. My immediate thoughts were that it resembles message queue mechanics, such as https://www.rabbitmq.com, https://kafka.apache.org, or perhaps even https://elixir-lang.org/getting-started/processes.html (lightweight processes, each with their own “mailbox,” communicating via message passing). Is it accurate to think of core.async Channels as “the means to build your own message queues,” or perhaps as Clojure’s take on providing the facilities to implement something like https://en.wikipedia.org/wiki/Actor_model in one’s applications? Also, I see that https://clojure.org/reference/agents, which provide access to shared mutable state. This also seems to resemble something like the actor model in some ways. And I found https://clojure.org/about/state#actors, which explains how Agents differ from message passing and actors. But I’m struggling to grok this concept, how it relates to core.async Channels, and core.async more broadly.

Ben Sless11:12:25

Channels are conceptually closer to message queues than actor model, and you can certainly think about them like an in memory rabbitmq or kafka, though without persistence. Conceptually, Clojure's design prefers queues over agents because they have no identity. "Actors complect what's going to be done and who is going to do it."

1
Ben Sless11:12:46

Queues decomplect what from when and where

leifericf15:12:44

> “Channels are conceptually closer to message queues than actor model, and you can certainly think about them like an in memory rabbitmq or kafka, though without persistence.” Thanks for confirming that, @UK0810AQ2!

Ben Sless15:12:10

@U01PE7630AC keep in mind that things like topics, subscribers and persistence behave very differently from something like Kafka

1
ghadi16:12:28

CSP: Communicating Sequential Processes is the umbrella topic you're looking for

1
ghadi16:12:15

golang also uses identical channels, you'll find a lot of other information in go

ghadi16:12:31

keep in mind there is nothing inherent about going across wires here