I am wondering why data from a core.async channel is retrieved by a pull mechanism in a endless loop. For example:
user=> (def c (chan 1))
#'user/c
user=> (go-loop []
(let [x (<! c)]
(println "Got a value in this loop:" x))
(recur))
#<ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@30df0e27>
ref: https://clojuredocs.org/clojure.core.async/go-loop#example-542c88e3e4b05f4d257a297b
Why isn't there a push mechanism which I could hook onto? Or why isn't such a loop some implementation detail of core.async subscriber? I think having a mechanism running endlessly is very cpu consuming. Is this not the case?