How to stop Jetty Server in CLOJURE?

I use ring and clojure to write a web application. I use jetty adapter for development server and emacs/SLIME IDE. Although wrap-reload helps, run-jetty blocks my slime session, and I want to be able to start/stop it without having to run it in a separate terminal session. Ideally, I want to define a server proxy and functions start-server and stop-server, which will start/stop the server in the proxy. is it possible?
I usually have a line in my ring application that looks like the following:

(defonce server (run-jetty #'my-app {:port 8080 :join? false}))

This prevents the REPL from being locked. It also allows me to recompile this file without worrying about my server being redefined. It also allows you to interact in the REPL like this:

user=> (.stop server)

and

user=> (.start server)

I use ring and clojure to write a web application. I use jetty adapter for development server and emacs/SLIME IDE. Although wrap-reload helps, run-jetty blocks my slime session, and I want to be able to start/stop it without having to run it in a separate terminal session. Ideally, I want to define a server proxy and functions start-server and stop-server, which will start/stop the server in the proxy. is it possible?

I usually have a line in my ring application that looks like the following:

(defonce server (run-jetty #'my-app {:port 8080 :join? false}))

This prevents the REPL from being locked. It also allows me to recompile this file without worrying about my server being redefined. It also allows you to interact in the REPL like this:

user=> (.stop server)

and

user=> (.start server)

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4591 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.