Window and Buffer

Frequently you will need to cut an input stream into samples or groups. Rx Windows allow you to do this based on any number of criteria. For example, given a stream of failed logins, determine whether five logins have failed within a three-minute window.

The Window method is used to cut your input stream into segments called (surprise!) Windows, such that each Window has a start and an end. For example, you might have Windows such as “from 3 p.m. to 4 p.m.” and “from 4 p.m. to 5 p.m.” or you might have a Window such as “from when they click the button until they let go.” A very simple example of Windows would be to cut the stream into groups of four items each (start is an empty window and end is when we've seen four items). ...

Get Programming Reactive Extensions and LINQ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.