Liking cljdoc? Tell your friends :D

babashka.nrepl.server.middleware


default-middlewareclj

source

default-middleware-with-extra-opsclj

(default-middleware-with-extra-ops op-handlers)

Use the default handler, but use the map of op-handlers first.

op-handlers should be a map of op => handler.

A handler is function that receives three arguments, [rf result nrepl-request]. The rf argument should be called with result and the nrepl-response. For multiple synchronous responses, the result of calling rf should be chained.

Example:

  (middleware/default-middleware-with-extra-ops
   {:foo (fn [rf result request]
           (-> result
               (rf {:response {:foo-echo (-> request :msg :foo)}
                    :response-for request})
               (rf {:response {:bar-echo (-> request :msg :bar)}
                    :response-for request})))})
Use the default handler, but use the map of `op-handlers` first.

`op-handlers` should be a map of `op` => `handler`.

A handler is function that receives three arguments, [rf result nrepl-request].
The `rf` argument should be called with result and the `nrepl-response`. For multiple synchronous
responses, the result of calling rf should be chained.

Example:

```
  (middleware/default-middleware-with-extra-ops
   {:foo (fn [rf result request]
           (-> result
               (rf {:response {:foo-echo (-> request :msg :foo)}
                    :response-for request})
               (rf {:response {:bar-echo (-> request :msg :bar)}
                    :response-for request})))})
```
sourceraw docstring

default-process-msgclj

(default-process-msg rf result msg)
source

default-xformclj

Default middleware used by sci nrepl server.

Default middleware used by sci nrepl server.
sourceraw docstring

middleware->xformclj

(middleware->xform middleware)

Converts a set of middleware functions into a transducer that can be used with the sci nrepl server.

Middleware functions will topologically sorted based off the meta data keys :babashka.nrepl.server.middleware/requires and :babashka.nrepl.middleware/expects.

Converts a set of middleware functions into a transducer
that can be used with the sci nrepl server.

Middleware functions will topologically sorted based off the
meta data keys :babashka.nrepl.server.middleware/requires and :babashka.nrepl.middleware/expects.
sourceraw docstring

wrap-process-messageclj

(wrap-process-message rf)

Middleware for producing responses based on op code.

Middleware for producing responses based on op code.
sourceraw docstring

wrap-read-msgclj

Middleware for normalizing an nrepl message read from bencode.

Middleware for normalizing an nrepl message read from bencode.
sourceraw docstring

wrap-response-forclj

Middleware responsible for updating message with session and id.

Middleware responsible for updating message with session and id.
sourceraw docstring

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

× close