A Reactive Application

Before we dive into the C# language feature called events, let’s see how far the observation from the previous two figures brings us by using bare-bone delegates to create a reactive application. To keep things simple, we continue our way in the good old world of console applications to implement a countdown mechanism that’s operated as follows:

• The user sets the number of seconds to count down.

• The user instructs the countdown mechanism to start.

• The countdown raises a signal for every second that has elapsed.

• The countdown raises an event when the countdown has reached zero.

By looking at the predicate of the preceding sentences, you can decide whether the described operational step is interactive or reactive. ...

Get C# 4.0 Unleashed 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.