This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-15
Channels
- # arachne (6)
- # aws-lambda (3)
- # beginners (14)
- # boot (56)
- # cider (8)
- # cljs-dev (5)
- # cljsrn (11)
- # clojure (240)
- # clojure-dusseldorf (3)
- # clojure-greece (165)
- # clojure-italy (5)
- # clojure-romania (1)
- # clojure-russia (24)
- # clojure-uk (30)
- # clojure-ukraine (3)
- # clojurescript (29)
- # core-async (6)
- # css (1)
- # cursive (25)
- # datascript (6)
- # datomic (61)
- # dirac (1)
- # events (3)
- # hoplon (1)
- # instaparse (3)
- # jobs (4)
- # juxt (28)
- # lein-figwheel (7)
- # leiningen (19)
- # luminus (1)
- # lumo (2)
- # nyc (1)
- # off-topic (19)
- # om (25)
- # onyx (4)
- # parinfer (2)
- # pedestal (23)
- # perun (20)
- # re-frame (44)
- # reagent (20)
- # remote-jobs (3)
- # ring (3)
- # ring-swagger (5)
- # rum (12)
- # slack-help (3)
- # spacemacs (25)
- # specter (62)
- # sql (16)
- # unrepl (313)
- # yada (4)
@ddeaguiar Where should I start reading the code base to better understand what's going on?
@alanspringfield I’d start with the io.pedestal.http
ns. Basically work you way back from create-server
(https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http.clj#L341) to see things are initialized. Where you go from there is up to you. Good candidates are the io.pedestal.http.route
ns (https://github.com/pedestal/pedestal/blob/master/route/src/io/pedestal/http/route.clj) or the io.pedestal.interceptor
ns (https://github.com/pedestal/pedestal/blob/master/interceptor/src/io/pedestal/interceptor.clj).
The code is really clean so it should be pretty easy to follow. Keep an eye out for abstractions as you go through it
Just having an understanding of what’s going on in io.pedestal.http
goes a long way imo
Knowing what default interceptors get wired up when is super useful. https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http.clj#L180
anybody using pedestal sse for broadcasting?
Hey all, checking in mid-week during spring break here. Catching up on the conversation, so I’ll be shotgunning out on some different topics.
@rafaelzlisboa Yes, we’re definitely using SSE for broadcasting events.
what’s the best way to set it up?
what i’m doing is using a mult
and tap
ping the individual channels into a broadcaster main channel, with a watchdog to release them when there is a timeout. just wondering if there’s an easier way to implement it
I’ve not had good luck with mult and tap in the past. There’s something about them that I don’t understand. I keep a map with the connected clients. The start-event-stream function lets me identify a disconnect function that I use to clean up the map.
hmmm… then go through the entire map whenever we want to broadcast?
Here’s an excerpt: https://gist.github.com/mtnygard/3c05c26f4cfad420eee6ce32ac03819f
nice! I guess right now we’re at the point of not having good luck with mult and tap hahah. it randomly stops working somedays
Yeah, I didn’t track it down far enough but it seemed like I couldn’t effectively isolate errors/slowdowns on one tap from others.
thanks for the tip
@alanspringfield Vase builds on Pedestal, so learning Pedestal is definitely a good start. Going through the HTTP namespace as @ddeaguiar suggests is the “outside to inside” approach. Depending on your learning style, you may also benefit from an “inside to outside” approach… that would be starting with the interceptors module. Pretty much everything that makes Vase interesting is about building interceptors out of data.
@alanspringfield As you get started, please take notes of anything that bites you. Or anything that just bites. The notes from @deg on doc deficiencies have been great. Each time someone goes through the process we can learn from anything that makes them stumble.
@bradford I know a few people have done multipart forms that include uploads. IDK if that means multiple parallel uploads. The multipart form upload ring middleware is probably the quickest path to done.