This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-10
Channels
- # aleph (1)
- # beginners (4)
- # biff (7)
- # calva (7)
- # cider (8)
- # clara (17)
- # clerk (19)
- # clj-kondo (30)
- # clojure (12)
- # clojure-austin (1)
- # clojure-europe (12)
- # clojure-losangeles (1)
- # clojure-norway (21)
- # clojurescript (2)
- # datalevin (1)
- # datomic (24)
- # duct (3)
- # fulcro (8)
- # hyperfiddle (8)
- # lambdaisland (4)
- # membrane (6)
- # missionary (7)
- # off-topic (55)
- # overtone (2)
- # reagent (4)
- # reitit (4)
- # releases (6)
- # shadow-cljs (80)
The https://cljdoc.org/d/missionary/missionary/b.33/api/missionary.core#reductions`m/reductions` says that it returns a discrete flow, but doesn't it actually return a continuous flow?
The docstring is indeed not great. The flow returned by m/reductions
is initialized. If it's initialized AND decoupled, then it's continuous. Otherwise it is discrete
what is “decoupled”
are these statements true?
1. "continuous flow" could be defined as any flow that is both initialized and decoupled.
2. "discrete flow" could be defined as any flow that is either not initialized, not decoupled, or both.
3. consumers of a decoupled flow do not place backpressure on producers.
4. consumers of coupled flows do place backpressure on producers.
5. "continuous flows" model continuous time, since they can be sampled at any point in time (thanks to initialization and decoupling)
6. "discrete flows" model discrete events. It is often unsafe to drop discrete events (think delta encoding,) so they need backpressure.
7. ...but sometimes you can transform discrete events into a continuous flow by reducing events into state. Example: events representing integer additions to a counter. Since state can (by definition) be sampled at any point in time, reducing these add
events (via m/reductions
) decouples the producer (event emitter) from the consumer (flow consumer.)