leonoel / missionary

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

sample should not notify before continuous input is available #33

Closed leonoel closed 2 years ago

leonoel commented 3 years ago
  (def it ((m/sample vector
             (m/observe (fn [!] (def continuous !) #()))
             (m/observe (fn [!] (def discrete !) #())))
           #(prn :ready) #(prn :done)))

  (discrete 0)                                              ;; should not be ready, because continuous input is not ready.
leonoel commented 3 years ago

Related question : when should the sampler flow start ?

  1. immediately on sample start
  2. when the sampled flow becomes ready to emit its first value (consequently : sampler is never started if sampled terminates without notifying)
leonoel commented 2 years ago

Irrelevant since continuous flows are now required to be immediately ready