CancellationToken and Reactive Extensions
I need to cancel a subscription


If you're actually subscribing to the source using Subscribe(), then that has overloads that accept a CancellationToken, you might want to consider using that.



Observable.Create&lt;object&gt;(observer =&gt; token.Register(() =&gt; observer.OnNext(null)));


It took me a while to figure out that this doesn't cause a memory leak. I thought that since you call Register(), but never use the returned IDisposable to unregister, the registrations will stay there even when they are no longer needed. But that's not true, because the IDisposable is actually returned to Create(), which will Dispose() it when it's no longer needed.

I think this is confusing enough that it warrants a comment explaining the situation.

Also, the common way to express the void type in generics in Rx is the Unit type, not object:

Observable.Create&lt;Unit&gt;(observer =&gt; token.Register(() =&gt; observer.OnNext(Unit.Default)));


This is longer than your code, but I think it's also clearer.