leonoel / missionary

A functional effect and streaming system for Clojure/Script
Eclipse Public License 2.0
630 stars 26 forks source link

behavior of continuous operators in face of consecutive transfers #47

Closed leonoel closed 2 years ago

leonoel commented 2 years ago

A consecutive transfer happens when a continuous flow notifies synchronously with the sampling. The current behavior is to propagate the consecutive transfer, but the point of continuous flow is that only the latest value matters therefore it may be more correct to collapse all consecutive transfers to keep only the latest.

A common scenario would be using reductions to turn a discrete flow into a continuous flow. If the discrete flow happens to have a first event available immediately, then a consecutive transfer happens.

(->> (m/reductions + (m/ap 1))
  (m/latest inc)
  (m/reduce conj)
  (m/?))

Currently this returns [1 2], with a collapsing latest it would return [2].

Impacted operators : latest signal! sample

leonoel commented 2 years ago

Fixed in b.25