@alukito if you want to synchronize the starting of multiple consumers, you can use the demand option. When you start the producer, you should return demand: :accumulate
on its init. Then you subscribe all children and you do a GenStage.demand/2
call setting it back to :forward
.
Your supervision tree would look like this:
- Producer
- Consumer1
- Consumer2
- Consumer3
- Temporary task that will change the demand
You want it to be one_for_all
, so any crash causes everything to restart.