Back

suspend-key! (clj)

(source)

multimethod

(suspend-key! key value)
Suspend a running implementation associated with a key, so that it may be eventually passed to resume-key. By default this multimethod calls halt-key!, but it may be customized to do things like keep a server running, but buffer incoming requests until the server is resumed.

Examples

integrant
(ns integrant.core-test
  (:require #?(:clj  [clojure.test :refer [are deftest is testing]]
               :cljs [cljs.test :refer-macros [are deftest is testing]])
            [integrant.core :as ig]
            [weavejester.dependency :as dep]))

(defmethod ig/suspend-key! :default [k v]
  (swap! log conj [:suspend k v]))
kit-clj/kit
(ns kit.edge.utils.nrepl
  (:require
    [clojure.tools.logging :as log]
    [integrant.core :as ig]
    [kit.ig-utils :as ig-utils]
    [nrepl.cmdline]
    [nrepl.server :as nrepl]))

(defmethod ig/suspend-key! :nrepl/server [_ _])
kit-clj/kit
(ns kit.edge.db.sql.hikari
  (:require
    [hikari-cp.core :as cp]
    [integrant.core :as ig]
    [kit.ig-utils :as ig-utils]
    ))

(defmethod ig/suspend-key! :db.sql/hikari-connection [_ _])
kit-clj/kit
(ns kit.edge.db.sql.conman
  (:require
    [conman.core :as conman]
    [integrant.core :as ig]
    [kit.ig-utils :as ig-utils]))

(defmethod ig/suspend-key! :db.sql/connection [_ _])

(defmethod ig/suspend-key! :db.sql/query-fn [_ _])
kit-clj/kit
(ns kit.edge.scheduling.quartz
  (:require
    [aero.core :as aero]
    [integrant.core :as ig]
    [kit.ig-utils :as ig-utils]
    [troy-west.cronut :as cronut]))

(defmethod ig/suspend-key! :cronut/scheduler [_ _])
robert-stuttaford/bridge
(ns bridge.web.jetty
  (:require [integrant.core :as ig]
            [ring.adapter.jetty :as jetty]))

(defmethod ig/suspend-key! :adapter/jetty [_ {:keys [handler]}]
  (reset! handler (promise)))