Liking cljdoc? Tell your friends :D

babashka.nrepl.server.middleware


default-middleware

source

default-middleware-with-extra-ops

(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-msg

(default-process-msg rf result msg)
source

default-xform

Default middleware used by sci nrepl server.

Default middleware used by sci nrepl server.
sourceraw docstring

middleware->xform

(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-message

(wrap-process-message rf)

Middleware for producing responses based on op code.

Middleware for producing responses based on op code.
sourceraw docstring

wrap-read-msg

Middleware for normalizing an nrepl message read from bencode.

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

wrap-response-for

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