ring icon indicating copy to clipboard operation
ring copied to clipboard

Add stop method for jetty adapter

Open darkleaf opened this issue 4 years ago • 0 comments

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))

darkleaf avatar Nov 16 '21 10:11 darkleaf