This is a simple implementation of a function chainer in C#, using AutoResetEvent and TaskFactory to control execution flow.
The code is meant for demonstration and educational purposes. I wrote it as an experiment while studying monads. The Task Parallel Library combined with the new async/await functionality can probably give you a better way to write async code.