Implements

Examples

This example demonstrates the use of the subject class. An instance of a Subject of the string type is used to subscribe to two example news feeds. These feeds just publish random news headlines at an interval no greater than five seconds apart. Two subscriptions against the subject’s observable interface are then created to receive the combined data stream. One subscription reports each item from the data stream as “all news”. The other subscription filters each headline in the stream to only report local headlines. The subscriptions both write each headline received to the console window. Processing terminates when the user presses the enter key and Dispose is called to cancel both subscriptions.