Uploaded image for project: 'ClojureScript'
  1. CLJS-2574

cljs.main: Graceful shutdown for browser REPL if timers in flight

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: None
    • Labels:
      None

      Description

      deps.edn:

      {:deps {org.clojure/clojurescript
              {:git/url "https://github.com/clojure/clojurescript"
               :sha "435af1a9ee69e225676fe743556d60efff5bde37"}}}
      

      Node and Nashorn have the desired shutdown-blocking property, but not Browser:

      $ clj -m cljs.main -re nashorn -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
      #object[Object]
      :goodbye
      :hi
      $ clj -m cljs.main -re node -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
      #object[Timeout [object Object]]
      :goodbye
      :hi
      $ clj -m cljs.main -re browser -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
      Compiling client js ...
      Serving HTTP on localhost port 9000
      Listening for browser REPL connect ...
      13
      :goodbye
      

      This would be useful for running asynchronous tests, like those in core.async.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mfikes Mike Fikes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: