This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-03
Channels
- # adventofcode (198)
- # aleph (10)
- # announcements (7)
- # aws (17)
- # beginners (353)
- # boot (1)
- # calva (13)
- # cider (18)
- # cljdoc (2)
- # cljs-dev (11)
- # cljsrn (1)
- # clojure (87)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-greece (13)
- # clojure-italy (18)
- # clojure-kc (2)
- # clojure-nl (9)
- # clojure-quebec (1)
- # clojure-russia (1)
- # clojure-spec (55)
- # clojure-uk (114)
- # clojurescript (18)
- # clojurex (14)
- # code-reviews (5)
- # core-async (17)
- # cursive (23)
- # data-science (1)
- # datomic (82)
- # docker (8)
- # duct (10)
- # emacs (8)
- # figwheel (3)
- # figwheel-main (5)
- # fulcro (13)
- # hyperfiddle (8)
- # jobs (1)
- # midje (1)
- # mount (1)
- # nrepl (2)
- # off-topic (72)
- # om (2)
- # pathom (10)
- # portkey (2)
- # re-frame (9)
- # reagent (3)
- # reitit (9)
- # ring-swagger (14)
- # schema (1)
- # shadow-cljs (91)
- # spacemacs (21)
- # sql (6)
- # tools-deps (19)
- # unrepl (9)
- # vim (41)
Hi, just a small question. While reading aleph Websockets samples, I found this:
;; take all messages from the client, prepend the name, and publish it to the room
(s/consume
#(bus/publish! chatrooms room %)
(->> conn
(s/map #(str name ": " %))
(s/buffer 100)))
What’s the meaning here of wrapping the source stream with a buffer? As far as I understand, it’s important when sending messages into a stream. But what does buffering when reading messages?I believe that without the buffer sending a message from a client would "block" until all participants have received it
Per https://github.com/ztellman/manifold/blob/master/docs/stream.md#buffers-and-backpressure > We saw above that if we attempt to put a message into a stream, it won't succeed until the value is taken out. This is because the default stream has no buffer
yeah, but then the example wouldn't work, right? I mean, the example is sending a single message by each client 😕
It would. There is a video when the author says, without a buffer a slow client may slow down everybody
@igrishaev - this is where ztellman talks about buffering and throttling chats: https://www.youtube.com/watch?v=1bNOO3xxMc0&t=1887