Fork me on GitHub
#missionary
<
2023-09-08
>
alex16:09:42

Hi there, I'm collecting a batch of updates that are reduced through an m/reductions and ultimately returns a map. The last step of the flow is an m/reduce which takes the map and makes an asynchronous update. I would like to throttle the m/reduce and only call it max once per every pre-defined interval. Is there a Missionary primitive for achieving this or should I just implement a generic throttle helper?

leonoel18:09:20

> an m/reduce which takes the map and makes an asynchronous update this looks like a smell to me, if async is needed you need an intermediate m/ap stage before final reduction

alex20:09:26

Sorry I wasn't being super precise with my description. It's a call to update application state in the client/browser, and the event is dispatched to a scheduler that batches updates together Specifically calling a dispatch! event in the context of this https://github.com/clj-commons/citrus library to update application state Technically it is an asynchronous call but I don't need to wait for results or anything. Would it still make sense to use an intermediate m/ap stage?

leonoel20:09:59

no, calling dispatch! in reduce is correct

👍 2