Can I use reactive extensions in a MonoTouch project?

There is an Rx port called mono-reactive that contains the MonoTouch project, but the author announced ten days ago that he was abandoning the project in favor of an open source Microsoft implementation:

I am pleased to announce that I will no longer work on this code base now that Microsoft has active open source resources under the Apache license. http://rx.codeplex.com/

MonoDevelop hangs trying to open Rx.sln in Rx master , and there is no MonoTouch target there. PCL support does not yet exist for MonoTouch .

I am wondering if someone has already posted a project compatible with MonoTouch for Rx, and whether it can really be used in production.

+8
c # system.reactive xamarin
source share
1 answer

Microsoft rx

I myself created the project by combining the Kernel , Interfaces , Linq, and PlatformServices from Rx codeplex .
There you go:

https://github.com/stampsy/rx-monotouch

It works great with reference types, and even more so with value types (see below).
Unfortunately, it does not compile due to errors 8329 and 9087 . Now it compiles.

mono-reactive

I also used mono-reactive and it worked very well for me. While Microsoft's implementation seems more concise and reliable, monoreactivity is smaller and easier to fix when it really is needed.

You can try both and see what works best for you.
Happy observation!

Mitigating Failures

In both environments, I often encountered crashes caused by AOT device restrictions. Rolf Hamarin told me that you can often work with most AOT restrictions on without using value types like Rx.

For example, the IObservable<bool> extensions are likely to get corrupted on the device, and this will be the IObservable<long> , but reference types should work fine with most methods.

In my version of Rx, I added an IntervalSafe method that returns Unit (which I changed as a reference type, not a structure) instead of long and therefore does not cause dozens of crashes throughout the code base.

Some Rx methods still crash, but it's pretty easy to fix these crashes .

See Throttle fix with Costo or my Buffer fix for help.
I am pleased to combine traction requests that will appeal to other Rx methods and their overloads.

+8
source share

All Articles