O'Reilly logo

Programming Reactive Extensions and LINQ by Paul Betts, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required