Book Image

Reactive Programming for .NET Developers

Book Image

Reactive Programming for .NET Developers

Overview of this book

Reactive programming is an innovative programming paradigm focused on time-based problem solving. It makes your programs better-performing, easier to scale, and more reliable. Want to create fast-running applications to handle complex logics and huge datasets for financial and big-data challenges? Then you have picked up the right book! Starting with the principles of reactive programming and unveiling the power of the pull-programming world, this book is your one-stop solution to get a deep practical understanding of reactive programming techniques. You will gradually learn all about reactive extensions, programming, testing, and debugging observable sequence, and integrating events from CLR data-at-rest or events. Finally, you will dive into advanced techniques such as manipulating time in data-flow, customizing operators and providers, and exploring functional reactive programming. By the end of the book, you'll know how to apply reactive programming to solve complex problems and build efficient programs with reactive user interfaces.
Table of Contents (15 chapters)
Reactive Programming for .NET Developers
About the Authors
About the Reviewer

Time-based sequence creation

In the previous sections, we had the opportunity to create simple sequences from known values or by executing some specific code.

Although these opportunities give us the chance to create useful message sequences, in the real world, reactive programming deals with some kind of time-based messages.


The easiest form of time-based interaction is the polling design. This design, typical of nonreactive programming, happens anytime we ask for a value or a state at a fixed time interval. Similarly, within the reactive programming, we may produce messages at a fixed time interval running in a push design to use the value itself or to trigger other logics available in the following sequence chain.

The Interval operator produces a similar design by specifying the wanted time interval, receiving a counter of the current tick as the Int64 value.

Here's an example:

static void Main(string[] args) 
    //this sequence produces a message per second