On 16/11/13 21:22, Craig wrote:
Very interesting. I have a similar requirement, but not in serving web requests. I haven't looked under the covers of your module, but wonder if it could be decoupled from web/ring?
Craig
I've just pushed 0.2.0-SNAPSHOT to Clojars and Github. This adds 
overload-middleware.middleware/create-overload-wrapper, which takes two 
arguments - a function that can be applied to a request to generate an 
"overloaded" response (to account for protocols that need to copy some 
request info back into the response, unlike HTTP), and a function that 
can be applied to a response to determine whether it is indicating 
overload (which can just be "(constantly false)" if your application 
doesn't do this). It returns a function which behaves like the existing 
wrap-overload.
As an example, the new definition of wrap-overload is:

(def wrap-overload (create-overload-wrapper
                    (constantly {:status 503 :body "Overloaded"})
                    #(= 503 (:status %))))

Does this sound like it fits your use-case?

Best,
Rob

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to