ring
ring copied to clipboard
Add stop method for jetty adapter
It is useful for stopping a server without reflection warnings.
(ns some-ns
...
(:import
[org.eclipse.jetty.server Server]))
(defmethod ig/halt-key! ::adapters/jetty [_ ^Server server]
(.stop server))
vs
(defmethod ig/halt-key! ::adapters/jetty [_ server]
(jetty/stop server))
or even for lazy loading:
(defmethod ig/halt-key! ::adapters/jetty [_ server]
((requiring-resolve 'ring.adapter.jetty/stop) server))