This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-04
Channels
- # admin-announcements (33)
- # announcements (2)
- # beginners (10)
- # boot (200)
- # cider (25)
- # cljs-dev (13)
- # clojure (75)
- # clojure-canada (2)
- # clojure-czech (1)
- # clojure-dev (16)
- # clojure-japan (7)
- # clojure-russia (20)
- # clojurescript (206)
- # clr (1)
- # cursive (24)
- # datascript (1)
- # datomic (1)
- # editors (2)
- # hoplon (136)
- # ldnclj (54)
- # off-topic (9)
- # om (5)
- # onyx (8)
- # re-frame (66)
- # reagent (19)
- # yada (21)
@dnolen: would you consider a patch to core.async
so that (<! (timeout 0))
got as close to 0 as possible.
Currently (<! (timeout 0))
will take about 4ms on a modern browser because it ends up as (js/setTimeout f 0)
which, on a modern browser means about a 4ms delay, and that's too long if you are just wanting to hand back control to the browser for the minimum about of time.
See:
https://github.com/clojure/core.async/blob/d073896192fa55fab992eb4c9ea57b86ec5cf076/src/main/clojure/cljs/core/async/impl/timers.cljs#L161-L164
followed by:
https://github.com/clojure/core.async/blob/d073896192fa55fab992eb4c9ea57b86ec5cf076/src/main/clojure/cljs/core/async/impl/dispatch.cljs#L35-L36
I was imagining the following tiny rewrite:
(defn queue-delay [f delay]
(if (= 0 delay)
(goog.async.nextTick f) ;; <---- new path for 0
(js/setTimeout f delay))
Uggh. This got a bit long, sorry. Should be a ticket. But just wondered if it would be considered by you as worthwhile before I go to the effort of a ticket.
@mikethompson: I am not really the person to talk to about core.async
@dnolen: seeing the Closure bump in cljs: how do you package up closure? I remember that you said stuartsierra does it? is that process documented somewhere?
@martinklepsch: you mean Closure Library, yeah there’s some simple deploy steps for that in Hudson
I think for CLJS people wanting to hack on Closure itself it’d be neat to know
@martinklepsch: script/closure-library-release/closure-library-release.sh
Ah cool. Thanks!
@martinklepsch: I fixed that script so that it installs to local Maven if not on Hudson
@dnolen: thanks good to know