notespace icon indicating copy to clipboard operation
notespace copied to clipboard

requiring the notespace ns, prevents JVM from shutting down

Open behrica opened this issue 4 years ago • 5 comments

Executing his code via clojure command line tool clj, throws exception and prevents JVM shutdown

(ns scicloj.metamorph-examples.try-exit
(:require [notespace.api :as note]))
(shutdown-agents)

without (shutdown-agents), the JVM does not shutdown, but no exception is seen

behrica avatar Mar 06 '21 15:03 behrica

see here: https://clojurians.zulipchat.com/#narrow/stream/224153-notespace-dev/topic/requiring.20.22notespace.22.20.2B.20prevents.20JVM.20from.20exiting

behrica avatar Mar 06 '21 15:03 behrica

adding System/exit works:

(ns scicloj.metamorph-examples.try-exit
(:require [notespace.api :as note]))
(System/exit 0)

behrica avatar Mar 06 '21 15:03 behrica

As a workaround this works.

clj -e '(load-file "src/scicloj/metamorph_examples/titanic.clj")(System/exit 0)'

behrica avatar Mar 06 '21 15:03 behrica

As we have now the cli namespace in notespace we can now render notespaces to html via a commandline like:

clj -Atest -e "(require 'notespace.cli)(notespace.cli/eval-and-render-a-notespace {:ns 'scicloj.ml.titanic :config-updates {:source-base-path \"userguide\"}})(System/exit 0)"

This is cools specifically if using notespace for documentation of something, so teh html generation can be part of build.

Due to this issue, we need teh (System/exit 0), which is a bit of a pitty.

behrica avatar Sep 03 '21 21:09 behrica

Thanks, @behrica. I hope we solve such things in the near future.

daslu avatar Sep 05 '21 12:09 daslu