(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})))}) ```
Default middleware used by sci nrepl server.
Default middleware used by sci nrepl server.
(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.
(wrap-process-message rf)
Middleware for producing responses based on op code.
Middleware for producing responses based on op code.
Middleware for normalizing an nrepl message read from bencode.
Middleware for normalizing an nrepl message read from bencode.
Middleware responsible for updating message with session and id.
Middleware responsible for updating message with session and id.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close