vert-x / mod-lang-clojure

Vert.x 2.x is deprecated - use instead
http://vertx.io
Other
74 stars 15 forks source link

Clojure runtime gets shut down prematurely when reloading an embedded app #94

Closed malchmih closed 10 years ago

malchmih commented 10 years ago

Created a simple project for this (https://groups.google.com/forum/#!topic/vertx/PEEouE8SPDE) discussion - https://github.com/malchmih/vertx-repl. It is based on Stuart Sierra's workflow. When you connect using "lein repl" you can start and reload code with user/reset function. After calling it three times (one to start and next two to reload) REPL connection breaks.

tobias commented 10 years ago

I believe the issue is that ClojureRuntimeFactory shuts down the agent thread pool when the factory instance is closed, which would kill nREPL. I've pushed a potential fix for that - it solves the problem for me locally using your test app. You can try it by using version 0.5.0-SNAPSHOT in your project.clj and server.clj. You may also need to add the sonatype snapshots repo to project.clj:

...
:repositories [["sonatype snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"]]
...
malchmih commented 10 years ago

Works for me, great!

tobias commented 10 years ago

Great news, closing.