This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-09
Channels
- # adventofcode (132)
- # announcements (19)
- # babashka (7)
- # babashka-sci-dev (6)
- # beginners (46)
- # calva (25)
- # chlorine-clover (5)
- # cider (2)
- # clara (17)
- # clj-kondo (93)
- # clojure (2)
- # clojure-dev (4)
- # clojure-europe (12)
- # clojure-losangeles (3)
- # clojure-nl (7)
- # clojure-uk (4)
- # clojurescript (29)
- # conjure (6)
- # core-async (8)
- # cursive (16)
- # data-science (7)
- # datomic (1)
- # exercism (4)
- # figwheel-main (8)
- # fulcro (9)
- # graphql (2)
- # helix (1)
- # introduce-yourself (3)
- # jobs (3)
- # lsp (4)
- # malli (20)
- # minecraft (3)
- # nextjournal (62)
- # off-topic (16)
- # overtone (34)
- # pathom (5)
- # polylith (10)
- # portal (1)
- # re-frame (104)
- # reagent (29)
- # reitit (1)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (22)
- # spacemacs (2)
- # sql (10)
- # tools-deps (17)
- # vim (13)
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.
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."
> “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!
@U01PE7630AC keep in mind that things like topics, subscribers and persistence behave very differently from something like Kafka