Liking cljdoc? Tell your friends :D

nrepl.server

Default server implementations

Default server implementations

default-handler

(default-handler & additional-middlewares)

A default handler supporting interruptible evaluation, stdin, sessions, and readable representations of evaluated expressions via pr.

Additional middlewares to mix into the default stack may be provided; these should all be values (usually vars) that have an nREPL middleware descriptor in their metadata (see nrepl.middleware/set-descriptor!).

A default handler supporting interruptible evaluation, stdin, sessions, and
readable representations of evaluated expressions via `pr`.

Additional middlewares to mix into the default stack may be provided; these
should all be values (usually vars) that have an nREPL middleware descriptor
in their metadata (see nrepl.middleware/set-descriptor!).
sourceraw docstring

default-middlewares

source

handle

(handle handler transport)

Handles requests received via [transport] using [handler]. Returns nil when [recv] returns nil for the given transport.

Handles requests received via [transport] using [handler].
Returns nil when [recv] returns nil for the given transport.
sourceraw docstring

handle*

(handle* msg handler transport)
source

start-server

(start-server &
              {:keys [port bind transport-fn handler ack-port
                      greeting-fn]})

Starts a socket-based nREPL server. Configuration options include:

  • :port — defaults to 0, which autoselects an open port
  • :bind — bind address, by default "127.0.0.1"
  • :handler — the nREPL message handler to use for each incoming connection; defaults to the result of (default-handler)
  • :transport-fn — a function that, given a java.net.Socket corresponding to an incoming connection, will return a value satisfying the nrepl.Transport protocol for that Socket.
  • :ack-port — if specified, the port of an already-running server that will be connected to inform of the new server's port. Useful only by Clojure tooling implementations.

Returns a (record) handle to the server that is started, which may be stopped either via stop-server, (.close server), or automatically via with-open. The port that the server is open on is available in the :port slot of the server map (useful if the :port option is 0 or was left unspecified.

Starts a socket-based nREPL server.  Configuration options include:

* :port — defaults to 0, which autoselects an open port
* :bind — bind address, by default "127.0.0.1"
* :handler — the nREPL message handler to use for each incoming connection;
    defaults to the result of `(default-handler)`
* :transport-fn — a function that, given a java.net.Socket corresponding
    to an incoming connection, will return a value satisfying the
    nrepl.Transport protocol for that Socket.
* :ack-port — if specified, the port of an already-running server
    that will be connected to inform of the new server's port.
    Useful only by Clojure tooling implementations.

Returns a (record) handle to the server that is started, which may be stopped
either via `stop-server`, (.close server), or automatically via `with-open`.
The port that the server is open on is available in the :port slot of the
server map (useful if the :port option is 0 or was left unspecified.
sourceraw docstring

stop-server

(stop-server {:keys [open-transports server-socket], :as server})

Stops a server started via start-server.

Stops a server started via `start-server`.
sourceraw docstring

unknown-op

(unknown-op {:keys [op transport], :as msg})

Sends an :unknown-op :error for the given message.

Sends an :unknown-op :error for the given message.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close