missionary

2021-01-08T15:07:47.090Z

A little while ago I was asking questions in here that were essentially an attempt to learn missionary but eventually figure out how to use missionary to rewrite this code, (currently implemented with core.async): https://github.com/jjttjj/lmalob#syncing-up-the-feed-and-initial-lob but now that I'm attempting to actually implement it I'm thinking the minimal cases I was trying to solve in missionary were off a little bit. Essentially I have to collect all messages from a flow, asynchronously make an http request, when the http response comes in, compare it to the first collected message from the flow to see if it meets a certain condition, if so immediately stop collecting messages from the flow (so that subsequent messages can be used later by another process) and do something with the messages collected thus far and the http request. If the request doesn't meet the condition I need to wait a bit and try again. Is the best approach here still to model the http requests as a flow, wrap both flows that they can be identified, combine them with amb= and then integrate with a cond to wait for success condition? I keep wanting to use integrate + relieve to collect all messages, but drop the successive collections until ready to compare to the result of an http task and then to loop this somehow if it fails. But I can't seem to get anything like this working.