This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-15
Channels
- # aws (1)
- # beginners (6)
- # boot (25)
- # cider (30)
- # cljs-dev (50)
- # cljsrn (45)
- # clojure (98)
- # clojure-austin (5)
- # clojure-czech (1)
- # clojure-dev (21)
- # clojure-dusseldorf (29)
- # clojure-germany (2)
- # clojure-greece (117)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-russia (26)
- # clojure-serbia (10)
- # clojure-spec (123)
- # clojure-turkiye (1)
- # clojure-uk (27)
- # clojured (13)
- # clojurescript (57)
- # core-async (18)
- # cursive (13)
- # datomic (20)
- # defnpodcast (16)
- # emacs (8)
- # events (2)
- # figwheel (3)
- # instaparse (1)
- # jobs (3)
- # jobs-discuss (39)
- # klipse (9)
- # lumo (100)
- # mount (1)
- # numerical-computing (1)
- # off-topic (22)
- # om (34)
- # onyx (17)
- # pedestal (1)
- # perun (29)
- # re-frame (60)
- # reagent (16)
- # remote-jobs (8)
- # rethinkdb (6)
- # ring-swagger (19)
- # rum (1)
- # slack-help (1)
- # specter (3)
- # untangled (1)
- # yada (17)
does core.async/thread do anything in cljs/node.js? As a node.js noob Im having diffuculty with a go-loop that I want to be asynchronous, but just blocks the repl when running.
if you don't do any channel operations in your go loop it will never yield so other things can run
ok
(go-loop [old-t 0]
(when-not (.PerformKsmps csound Csound)
(let [tick (.GetControlChannel
csound Csound "tickcnt" nil)]
(when-not (= old-t tick)
(go (>! metro-channel tick)))
(recur tick))))
I am not sure how the clojurescript repl works, is metro-channel using a dropping buffer or anything like that?
so my question may just as well be, how to start infinite loop in node.js without blocking everything 🙂
if you replaced the go-loop with a something like (fn f [] (async/go .... (f))) that would run f over and over but still yield the thread
javascript isn't my area of expertise, but you may want to not use a go block at all, and use some kind of scheduled execution facility, I think there is some js function you can call to execute code every N milliseconds sort of thing
tja jah, ok. 🙂 I need to dig deeper. Im seeing if I can change to node.js for musical creation, so latency involved with timouts could be too much. But .PerformKsmps is in clj a blocking call, it waits until 1 unit of musical time passes before recurcion. So as I type this, I may need to rethink this loop in js world.