missionary

braai engineer 2024-11-19T09:34:18.195789Z

Is there an arity of m/latest that takes a coll of N signals so I can wait on all the signals I defined before? I.e. instead of (m/signal (m/latest vector , Something like: (m/signal (m/all vector [ Or can I m/reduce over a coll of signals? I can do (apply m/latest vector signals) but that still builds up a long arg list, and I'm not sure how long that list can be. I see the underlying implementation of m/latest is Latest/run, which takes a coll of signals (`fs`).

leonoel 2024-11-19T09:45:26.263369Z

There is nothing wrong with (apply m/latest ,,,) on a large collection of inputs, the only limitation is the system memory

👍 1
braai engineer 2024-11-19T12:01:21.169479Z

m/latest doesn't like second arg being empty. What to use instead of m/latest if a flow has no dependencies?

leonoel 2024-11-19T12:05:25.565879Z

(m/cp (f))

braai engineer 2024-11-19T12:06:23.342419Z

awesome

leonoel 2024-11-19T12:12:48.820519Z

https://github.com/leonoel/missionary/issues/126

👍 1
braai engineer 2024-11-19T12:11:10.197629Z

Given a flow that ends in (m/reduce (fn [acc v] v) nil <signal-thingy), is there a way to get at v without sending printing or sending a message in the reducing function, or setting an atom? I guess because it's a continuous flow that makes no sense, right?

Andrew Wilcox 2024-11-21T05:37:26.513369Z

Well, the purpose of m/reduce is to take a complete stream of values and reduce it to a single value. If you want to do something else, m/reduce might not be the best choice. What do you want to do with v? m/cp can consume a continuous flow and produce a continuous flow, giving you access to the values, so you could pass your signal as input to the m/cp and pass the output of the m/cp to the reduce. m/signal could also be used to let you have multiple subscribers to the signal, so that you could have one subscriber running the reduce while another subscriber independently did something else with the values. But it depends on what you want to do.