This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-30
Channels
- # aws (1)
- # bangalore-clj (1)
- # beginners (73)
- # boot (13)
- # cider (3)
- # clara (19)
- # cljs-dev (33)
- # cljsrn (37)
- # clojure (177)
- # clojure-dev (13)
- # clojure-gamedev (1)
- # clojure-italy (10)
- # clojure-nlp (1)
- # clojure-russia (1)
- # clojure-spec (64)
- # clojure-uk (128)
- # clojurescript (177)
- # core-async (23)
- # cursive (5)
- # datascript (13)
- # datomic (20)
- # devops (49)
- # emacs (13)
- # graphql (5)
- # hoplon (13)
- # keechma (1)
- # leiningen (3)
- # liberator (4)
- # lumo (2)
- # off-topic (11)
- # om (19)
- # om-next (3)
- # onyx (6)
- # re-frame (13)
- # reagent (14)
- # ring-swagger (7)
- # rum (2)
- # spacemacs (7)
- # unrepl (1)
- # untangled (23)
- # vim (8)
- # yada (1)
so actually, is https://github.com/ztellman/aleph the most prominent cross-node communication library built on top core.async? or does it have a very different use case designation?
@matan not sure what you mean by built on top core.async
, Aleph doesn't use core.async at all, it's based on its own async abstractions (deferreds and streams defined in Manifold library)
mmm thanks for the correction @gsnewmark
does the status clause down at http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html really represent current status, or is it more of a blog post frozen in time?
easing in into core.async, may I ask what does parking a thread, in simple terms, actually mean? http://clojure.github.io/core.async/#clojure.core.async/go
I've not found Java documentation very straightforward about "thread parking", whereas I gather (?!) this is the crux of why go blocks are favorable to simple blocking code. So I guess this is key to understand.
concretely, below the hood, the go macro turns clojure code in to a state machine, and parking means suspending execution of that state machine until some operation on a channel causes it to continue
so when you "park" a go block, the state machine is handed to the channel you are waiting for the operation(put or take) on as a callback, and once someone else does the reciprocal action on the same channel, the callback is scheduled to execute on a threadpool thread
@hiredman thanks so much, now I understand why 'parking' is quoted in the docs https://clojuredocs.org/clojure.core.async/go 😂
so parking is entirely "logical" as it is merely something in a state machine, which go blocks build from the code they wrap. I guess no I'm getting the hang of it.
under the hood, is there a single thread driving the state machine of all go blocks "active" in a given program?
hmmmm still not sure why the doc mentions threads or what they mean there about 'parking' again > will block (if necessary) by 'parking' the calling thread rather than tying up an OS thread https://clojuredocs.org/clojure.core.async/go
as I said there isn't really a consistent name for thread of control that exists in a go block
that wording is using "thread" to refer to the thread of control in a go block, and OS thread to refer to java.lang.Thread which is these days synonymous with an operating system thread