2

There are zillions of concrete implementations of IEnumerable: List<T>, Dictionary<T>, etc. What concrete implementations of IObservable are available?

Qwertie
  • 16,354
  • 20
  • 105
  • 148

2 Answers2

4

Rx's ISubject implementations are some of the most common implementations of the IObservable interface. The list of the subject classes include:

Subject<T>
AsyncSubject<T>
BehaviorSubject<T>
ReplaySubject<T>

and the new

FastSubject<T>
FastAsyncSubject<T>
FastBehaviorSubject<T>
FastReplaySubject<T>

Subject classes represent objects that implement IObservable<T> and IObserver<T> and are used throughout the inner workings of the Rx library. They are also pretty invaluable if you are creating your own extention methods. You can find an explanation of each of these implementations on my recent question on the subject (no pun intended).

As Mauricio Scheffer mentioned, it is more commmon to use the Observable classes static methods and IObservable extention methods (System.Linq namespace) to retrieve IObservable instances.

Community
  • 1
  • 1
James Hay
  • 12,580
  • 8
  • 44
  • 67
3

What concrete implementations of IObservable are available?

AnonymousObservable<T> (internal), ConnectableObservable<T>, ListObservable<T>...

But the most common way to create IObservables is through System.Reactive's functions and extension methods (e.g. ToObservable()) (example)

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275