I have decided that I'll be splitting my program into different stages in order to handle a vast possibility of the type of packets that may be received and used within my blockchain. I am using the relatively low-level future 0.3
Sink async primitive for each stage.
As a packet arrives, it gets sent into sink 1 where its layout is verified (via Zerocopy). Then, it's pushed into a stage 2 sink which is where the packet-action is determined. There are more than a-f possible actions, but the diagram gets the idea across: I need to inevitably push all packets that get sent into stage 2n into a singular stage 3. I can do this very easily by giving an
UnboundedSender<Packet> into each stage 2n Sink type, and upon flushing, the packets get pushed through the sender. However, is there a way of handling the control flow I have a better/more-efficient way? Let's assume the case that millions of packets will possibly exist within this entire system.