Export (0) Print
Expand All

Unions

The examples in this topic demonstrate how to combine events from different streams by using a union operation. A union operation takes two input streams and combines the events to produce a single output event stream. A union operates on two CepStream<T> streams and combines them into one CepStream<T> stream.

The following example combines all events from stream1 with the events in stream2 into a single stream.

var unioned = stream1.Union(stream2);

The following example demonstrates how to union more than two streams by performing cascades of unary union calls. The first call combines the events from stream1 with the events from stream2. The resulting stream, unionTmp, is then combined with stream3 to produce the final output stream unionFinal.

var unionTmp = stream1.Union(stream2);
var unionFinal = unionTmp.Union(stream3);

Show:
© 2014 Microsoft