This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-26
Channels
- # announcements (9)
- # babashka (98)
- # beginners (53)
- # boot (2)
- # calva (19)
- # cider (58)
- # clj-kondo (4)
- # cljdoc (11)
- # clojure (49)
- # clojure-dev (12)
- # clojure-nl (3)
- # clojure-uk (4)
- # clojurescript (42)
- # core-async (6)
- # cursive (9)
- # data-science (1)
- # fulcro (23)
- # jobs-discuss (2)
- # nrepl (30)
- # off-topic (42)
- # pedestal (6)
- # re-frame (8)
- # reitit (7)
- # remote-jobs (2)
- # shadow-cljs (134)
- # specter (1)
- # vim (13)
Can I interrupt an “evaluation”, resulting from code like this:
(go
(while true
(println "hello")
(Thread/sleep 1000)))
@pez there is no way to interrupt that no. it would also occupy an entire thread from the thread pool so this must be avoided at all cost 😛
No, but it has similar constructs, no? So you can evaluate something and get “done” back and it would keep running.
but no you can't interrupt an infinite loop in JS. the browser will kill it eventually together with your page though 😉
if you just keep doing work nothing else will ever happen and your browser/node will lock up
So in a ClojureScript REPL, using nREPL, is it possible to interrupt this?
((fn foo []
(println "hello")
(js/setTimeout foo 1000)))
but no that will forever keep doing its thing. no way to stop it. at least it will allow the browser to do other stuff while waiting for the timeout 😛