metosin/reitit

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

开放

#599 创建于 2023年3月21日

 (1 条评论) (0 个反应) (0 位负责人)Clojure (261 个派生)batch import
help wanted

仓库指标

星标
 (1,569 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南