missionary

Andrew Wilcox 2024-04-17T00:46:30.298779Z

Here's a utility I've found helpful for debugging tasks and flows: https://gist.github.com/awwx/ab23234a7d3d43cf83003f3bf41937c7 It wraps a task or flow and reports on events: cancellation, task success or failure, flow notification and transfer, etc. I use it when I have a task or flow buried in the middle of my program and I need to find out if it's being canceled or not as I expect, whether it's throwing Cancelled or not, whether it's succeeding or failure or producing values.

((m/reduce {} nil
   (observe-flow "seed" (m/seed [1 2 3 4])))
 #(prn %) #(prn %))

seed :notified
seed :instantiated
seed :notified
seed :transferred-value 1
seed :notified
seed :transferred-value 2
seed :notified
seed :transferred-value 3
seed :terminated
seed :transferred-value 4
4

👍 3
😲 2
🙌 2
Eric Dvorsak 2024-04-17T09:33:36.154379Z

Amazing thanks for sharing!