mirror of
https://github.com/metosin/reitit.git
synced 2026-01-11 17:39:50 +00:00
refactor: Implement all Executor protocol method
This commit is contained in:
parent
e3180e4d6a
commit
8721c7ae37
3 changed files with 14 additions and 2 deletions
|
|
@ -7,6 +7,10 @@
|
|||
([type data]
|
||||
(throw (ex-info (str type) {:type type, :data data}))))
|
||||
|
||||
(defn unsupported-protocol-method!
|
||||
[method]
|
||||
(fail! :unsupported-protocol-method {:method method}))
|
||||
|
||||
(defn get-message [e]
|
||||
#?(:clj (.getMessage ^Exception e) :cljs (ex-message e)))
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
(:require [io.pedestal.http :as http]
|
||||
[io.pedestal.interceptor :as interceptor]
|
||||
[io.pedestal.interceptor.chain :as chain]
|
||||
[reitit.exception :as ex]
|
||||
[reitit.http]
|
||||
[reitit.interceptor])
|
||||
(:import (java.lang.reflect Method)))
|
||||
|
|
@ -51,6 +52,10 @@
|
|||
(map (fn [{::interceptor/keys [handler] :as interceptor}]
|
||||
(or handler interceptor)))
|
||||
(keep ->interceptor)))
|
||||
(execute [_ _ _]
|
||||
(ex/unsupported-protocol-method! 'reitit.interceptor/execute))
|
||||
(execute [_ _ _ _ _]
|
||||
(ex/unsupported-protocol-method! 'reitit.interceptor/execute))
|
||||
(enqueue [_ context interceptors]
|
||||
(chain/enqueue context interceptors))))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
(ns reitit.interceptor.sieppari
|
||||
(:require [reitit.interceptor :as interceptor]
|
||||
(:require [reitit.exception :as ex]
|
||||
[reitit.interceptor :as interceptor]
|
||||
[sieppari.core :as sieppari]
|
||||
[sieppari.queue :as queue]))
|
||||
|
||||
|
|
@ -15,4 +16,6 @@
|
|||
(execute [_ interceptors request]
|
||||
(sieppari/execute interceptors request))
|
||||
(execute [_ interceptors request respond raise]
|
||||
(sieppari/execute interceptors request respond raise))))
|
||||
(sieppari/execute interceptors request respond raise))
|
||||
(enqueue [_ _ _]
|
||||
(ex/unsupported-protocol-method! 'reitit.interceptor/enqueue))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue