Actors in the Reactive Extensions

If you have tried any of Erlang, Axum, or even F#, you’ll be familiar with the Actor model and coordinated, concurrent programming using channels. While looking through the Reactive Extensions, released during PDC 2009, I was intrigued by the ISubject<T> and ISubject<T1, T2> interfaces that implement both IObservable<T> and IObserver<T>. I asked whether this could be used as an Actor and received a response from none other than Erik himself that it was possible. Here’s the simple Ping Pong example, similar to those for Erlang, Axum, and F#. The good news is that this same approach will be available in all of the .NET languages, including F#. I wonder what the preferred F# approach will be.

Advertisements