This project shows clean restarting of Clojure programs in CIDER that use cron jobs and web servers without issuing any special commands from the command line.
No need to use "(.stop server)" when using ring.adapter.jetty for serving web pages. The web service is automatically stopped so that no "java.net.BindException" errors occur on restart.
Cron jobs using Overtone/at-at "Ahead-of-time function scheduler" are shut down and re-started without any interaction, stopping run-away threads.
- start Emacs
- load "clojure-reloadable-services/src/reload/web-cron.clj"
- M-x for "cider-jack-in"
- "Load this buffer" with web-cron.clj
- via the menu using "CIDER Eval | Load this buffer"
- or via C-c C-k
- in the CIDER window enter (reload.web-cron/main)
- Change code
- "Load this buffer" with web-cron.clj
- (reload.web-cron/main)
- (reload.web-cron/kill-services)