This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-26
Channels
- # announcements (7)
- # babashka (42)
- # beginners (349)
- # chlorine-clover (9)
- # cider (16)
- # circleci (2)
- # clj-kondo (6)
- # cljs-dev (61)
- # cljsrn (15)
- # clojure (95)
- # clojure-europe (11)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (24)
- # clojurescript (21)
- # conjure (2)
- # core-async (8)
- # cursive (12)
- # datascript (2)
- # emacs (4)
- # exercism (1)
- # figwheel-main (86)
- # fulcro (27)
- # graalvm (4)
- # helix (36)
- # hoplon (3)
- # interop (44)
- # kaocha (6)
- # lein-figwheel (4)
- # malli (7)
- # meander (9)
- # off-topic (95)
- # pathom (33)
- # pedestal (13)
- # re-frame (20)
- # reitit (3)
- # shadow-cljs (102)
- # tools-deps (14)
- # xtdb (16)
You can "leverage the interceptor model" by creating your own interceptor chain and run all onmessage
events through said chain. Pedestal interceptors are NOT coupled to HTTP, I've used them with queues, my own domain logic, I've even seen them with kafka.
We use them as wrappers around outgoing HTTP requests as well, to add logging/retries/QoS/encoding & decoding ...
lots of libs use that pattern now, it's basically an enhanced middleware pattern (open/modifiable stack/queue). There are also a few libs that make it usable with manifold, completablefutures, cljs etc (basically implementing their own chain runner, with some slight modifications sometimes, since it's not specified)
The difference between middleware and interceptors being functions
vs data
, respectively.
@joe.lane Thank you for the link. I really love the interceptor model. I find it much easier to wrap my head around than the middleware pattern. I have been looking at Sieppari for a general purpose interceptor chain but if Pedestal interceptors can be adapted, I will go with that instead.
FYI, I’ve created https://github.com/pedestal/pedestal/issues/659 to track the creation of a session-aware WebSocketListener impl