This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-28
Channels
- # admin-announcements (2)
- # alda (5)
- # arachne (4)
- # beginners (49)
- # boot (92)
- # capetown (3)
- # cider (9)
- # cljs-dev (6)
- # cljs-edn (1)
- # cljsjs (29)
- # cljsrn (4)
- # clojure (65)
- # clojure-android (1)
- # clojure-berlin (2)
- # clojure-chicago (2)
- # clojure-gamedev (2)
- # clojure-greece (11)
- # clojure-india (1)
- # clojure-japan (1)
- # clojure-new-zealand (2)
- # clojure-quebec (2)
- # clojure-russia (49)
- # clojure-spec (73)
- # clojure-uk (38)
- # clojurescript (118)
- # clojutre (4)
- # community-development (17)
- # cursive (3)
- # data-science (1)
- # datascript (1)
- # datomic (17)
- # emacs (6)
- # euroclojure (2)
- # events (2)
- # immutant (30)
- # keechma (11)
- # leiningen (4)
- # luminus (2)
- # off-topic (19)
- # om (14)
- # onyx (28)
- # planck (9)
- # re-frame (11)
- # reagent (35)
- # ring-swagger (4)
- # schema (4)
- # slack-help (6)
- # spacemacs (2)
- # specter (11)
- # testing (4)
- # untangled (88)
- # utah-clojurians (2)
- # vim (2)
- # yada (9)
Sorry for the crosspost but is there a way to wait for the immutant server to close? akin to aleph's wait-for-close
https://github.com/ztellman/aleph/blob/master/src/aleph/netty.clj#L732
@richiardiandrea: what does wait-for-close
do? block until the server exits?
the web server doesn't close until you close it, so I'm curious what your need really is?
Yes it does block the main Thread
@richiardiandrea: immutant.util/at-exit may help you. also, maybe look at https://issues.jboss.org/browse/IMMUTANT-605
Oh ok I'll have a look
It is a common problem when Java is executing all daemon threads, which are not stopping the JVM to shutdown...checking checking...thanks a lot
sure thing. if that doesn't meet all your needs, holler and maybe we can figure something out
thanks! I think I will need to wait on a promise that will be filled on at-exit
Simple enough 😄
(defn wait-for-close
[]
(let [promise (promise)]
(immutant.util/at-exit #(deliver promise "please shutdown"))
@promise))
@richiardiandrea: so i assume it makes no sense for you to do whatever you're waiting to do in the at-exit itself?
no I basically need to block the main thread from exiting
an alternative would be to have non-daemon threads running, so if the server can be set to have non-daemon threads
I would not even need the above workaround
i think i've seen some xnio daemon option somewhere. not sure how exposed it is.
quickly googling brings up this: https://github.com/spring-projects/spring-boot/commit/b79ee145d613bac8a0a58b28fc600f7ef9086621
they actually have the opposite problem there 😉
but it appears its default value is false
spotted 😉
ah-hah! 🙂
lemme see if that's still needed
@richiardiandrea: all tests are passing for me locally without setting that option. i've only tested in one container, and i'd like to confer with @tcrawley that we're actually testing the condition that code is affecting, but i think we can safely remove that. which is good, cuz i don't like that we're setting it.
yeah, i'm almost sure that was a workaround for a bug now obsolete with the versions of undertow & xnio we're currently using
ok good, I'd be glad to try it, let me know when it is up ok?
just one thing to keep in mind is that now the JVM won't exit until the server shuts down
i'm not seeing that locally. it's possible something else (undertow?) in the stack is doing it now
yeah it is possible that this is kind of hidden by the fact that run
is executed in -main
directly