I’m new to asynchronous programming and have a use case that I’m not sure how to express in terms of Julia concepts. I’d greatly appreciate any suggestions others may have to offer.
I have a task A, that consists of concurrent subtasks A1, A2, .. , An. Each subtask has a finite sequence of things to produce for a global consumer B, but at various points along its sequence it will need to wait for a response from B before continuing. However, B cannot interact with each subtask independently; due to interactions between the things produced by A1,…,An, B needs to wait until all the subtasks have reach a point where they waiting for a response from B. When this happens B will process everything they have produced in the meantime, then return responses to the respective subtasks so that they can continue. This back-and-forth continues until all the subtasks are finished, at which point A and B both conclude. They way I am thinking of the core interaction is that A1,…,An collectively yield to B and then B yields back collectively to A1,…,An, each one resuming where it left off. But I am not sure if that is a helpful way to think of it.
Any suggestions?