Reading One-to-Many Asynchronously

Turning an input stream coming from a single DataReader into several is accomplished using the DeMux class. DeMux is a special case because it's neither a reader or writer, it acts almost like a job, taking data from a reader and sending to the buffers of downstream readers.

The constructor for DeMux accepts a strategy that's responsible for what the downstream readers receive. The built-in implementations are DeMux.Strategy.BROADCAST

DeMux.Strategy.BROADCASTSends a copy of each record to every downstream reader.
DeMux.Strategy.ROUND_ROBINSends each record to a single downstream reader by cycling through the downstream readers one-at-a-time.

You can see a code example of DeMux in action in the data aggregation section on how to detail and summarize in a single pipeline.

Mobile Analytics