Back

stop-server (clj)

(source)

function

(stop-server) (stop-server name)
Stop server with name or use the server-name from *session* if none supplied. Returns true if server stopped successfully, nil if not found, or throws if there is an error closing the socket.

Examples

babashka/babashka
(ns babashka.impl.server
  (:require [babashka.impl.clojure.core.server :as server]
            [babashka.impl.common :as common]
            [babashka.impl.socket-repl :as socket-repl]
            [sci.core :as sci]))

(def clojure-core-server-namespace
  {'repl (sci/copy-var socket-repl/repl sns)
   'prepl (sci/copy-var prepl sns)
   'io-prepl (sci/copy-var io-prepl sns)
   'start-server (sci/copy-var start-server sns)
   'stop-server (sci/copy-var server/stop-server sns)})
kit-clj/kit
(ns kit.edge.utils.repl
  (:require
    [clojure.core.server :as socket]
    [clojure.tools.logging :as log]
    [integrant.core :as ig]))

(defmethod ig/halt-key! :repl/server
  [_ config]
  (socket/stop-server (:name config))
  (log/info "REPL server stopped"))
sereno-xyz/sereno
(ns app.repl
  "Server repl."
  (:require
   [clojure.tools.logging :as log]
   [clojure.spec.alpha :as s]
   [app.common.spec :as us]
   [clojure.core.server :as srv]
   [integrant.core :as ig]))

(defmethod ig/halt-key! ::server
  [_ name]
  (srv/stop-server name))