Closed mjmeintjes closed 2 years ago
This is expected behavior, it means you tried to change the graph topology outside of a propagation turn. In this example, the subscription to pub
is triggered by the sleep, which is foreign to the reactor.
In this other example, the subscription is well defined, because it is triggered by another publisher.
(m/?
(m/reactor
(let [pub (m/stream! (m/seed [1 2]))
evt (m/stream! (m/ap (m/? (m/sleep 0))))]
(m/stream!
(m/ap
(m/?> evt)
(println (m/?> pub)))))))
However println
will not called because pub
is already terminated when evt
emits.
The following code
throws
I was just wondering whether this is a bug, or expected behavior.