metosin/reitit

Missing `enqueue` method to use `routing-interceptor` with `sieppari`?

Open

#599 创建于 2023年3月21日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Clojure (1,569 star) (261 fork)batch import
help wanted

描述

Hi there! First off thank you for providing such a high-performance and versatile library, reitit allows one to nicely compose so many ideas from the clojure ecosystem :rocket:

In an effort to have an HTTP server whose execution flow is ridicolously straightforward to understand, I'm trying to achieve a fully interceptor driven server, where each interceptor has one and only one job.

For example the interceptor stack might look like:

  • exceptions interceptor
  • format interceptor
  • default handlers interceptor
  • routing interceptor

That said, I'm a bit puzzled as to how one is supposed to use the routing interceptor. Below is how I configured the interceptor, but if I try to run it, it rightfully complains that the sieppari executor doesn't have an enqueue method.

Is there a reason why the sieppari executor can't have an enqueue method? If not, would you be happy to accept a PR introducing it?

(reitit.http/routing-interceptor
    (reitit.http/router ["/api"
                         {:get (fn [req] {:status 200
                                          :body {:res 4 :params (:query-params req)}})}])
    nil
    {:executor reitit.interceptor.sieppari/executor})

Thanks, Simon

贡献者指南

Missing `enqueue` method to use `routing-interceptor` with `sieppari`? · metosin/reitit#599 | Good First Issue