Building Future T

The last post dealt with building the base Future class. Now we’ll build the child class used to run [Func](http://msdn2.microsoft.com /en-us/library/bb534960.aspx)'s.

Building The Base Future

In the end there are two basic types of Future implementations you can use.

Dealing With Exceptions In A Future

Besides waiting, the another important issue when dealing with Futures is how to deal with exceptions thrown by the user specified code.

Push Enumerators

If you read Jon Skeet’s blog you’ll notice he’s been playing around lately with “push” style enumerators. Push enumerators are the concept of “we’ll tell you when we’re ready”. This is different from IEnumerator which is more of a pull; "ask me if I have more data model".

The First Part Of Building A Future Is Waiting

Future’s are a great abstraction for asynchronous programming. One of the items making them so good is the easy manner in which you can declare one and wait for it to finish. The idea is to allow for many futures to be declared with as little overhead as possible. In order to do so you need to define an efficient way of waiting.