system.reactive

Max number of threads in Reactive Extensions / Parallel Extensions

Since Microsoft probably killed all download links to the Parallel Extensions CTP, I am totally lost. I want to specify the max number of tasks running at a certain time, as I want more threads than processors. Any clue how to do this in RX? ...

Has RX Extensions "solved" the problem of complex event driven programming?

I've been using Rx on a new financial analysis project that receives all data asynchronously. I've been pretty amazed at my personal productivity and how much more understandable my event based code is (as opposed to the previous model of event handlers with complex nested ifs and random state variables everywhere.). Has anyone else got...

Silverlight Toolkit DragDrop on WPF

Do Microsoft actually provide a build of Rx / Silverlight Toolkit DragDrop that "just works" on WPF? From what I can tell the Rx DragDrop stuff is only available in the SL Toolkit (not WPF). The SL Toolkit seems to imply you can use it in WPF (various #defines) but gives no further info on how to do it. If I just want the DragDrop stu...

Split an IObservable and then combine after processing?

After experimenting with IObservables, I've decided to test them for the processing of incoming messages over a message bus. Essentially I get an IObservable<Request> and the Request contains the necessary functions to reply to the response. At a point during processing I have to deserialize the data and convert it from a Request to a C...

Examples of useful or non-trival dual interfaces

Recently Erik Meijer and others have show how IObservable/IObserver is the dual of IEnumerable/IEnumerator. The fact that they are dual means that any operation on one interface is valid on the other, thus providing a theoretical foundation for the Reactive Extentions for .Net Do other dual interfaces exist? I'm interested in any exampl...

Why subscriptions interact with each other?

I am experimenting with RX, and run across the following problem (at least I perceive it as a problem). The following code creates an observable, and subscribes to it twice. I thought subscriptions should act independently, so the code below would output two lines, one for each subscription, on each key press. But this is not the case, I...

Reactive Framework vs PLINQ vs Task Parallel Library vs Parallel Extensions

In a few words, can anyone set the record straight what is what? Does this all end up in .NET 4.0 ? ...

Reactive Extensions Rx - unit testing something with ObserveOnDispatcher

I've some code in my view model as follows: miService.GetSomething(par1, par2) .ObserveOnDispatcher() .Subscribe(dt => { DoSomething(dt); }); Then in my test, I'm "mocking" my service as follows: miService.Setup(ms => ms.GetSomething(....)) .Returns(Observable.Return(XYZ)); The problem is that due to the ObserveOnDispatcher, ...

What is a good way to create an IObservable for a method?

Let's say, we have a class: public class Foo { public string Do(int param) { } } I'd like to create an observable of values that are being produced by Do method. One way to do it would be to create an event which is being called from Do and use Observable.FromEvent to create the observable. But somehow I don't feel good about...

Rewriting foreach using IObservable and Reactive Framework

I'm in VS2008 with Entity Framework. I'm accessing objects from the database using esql for WHERE IN functionality. I'm passing a ton of IDs to the select statement so I chunk it up into sets of 800. Then I merge the results together from each chunk. My goal is to obtain results for each chunk in parallel, rather than waiting synchrono...

RX IObservable as a Pipeline

Currently, I'm using the RX Framework to implement a workflow-like message handling pipeline. Essentially I have a message producer (deserializes network messages and calls OnNext() on a Subject) and I have several consumers. NOTE: If and transform are extension methods I have coded that simply return an IObservable. A consumer does so...

First faltering step with Reactive Extensions

I'm struggling with my first simple "hello world" RX application. I'm using VS2010 RC, plus the latest RX download. The following is the simple console app; class Program { static void Main(string[] args) { var channel = new MessageChannel() .Where(m => m.process) .Su...

Exposing ConcurrentQueue<T> as IObservable<T> ?

I wondered if it's possible to use a queue (specifically as ConcurrentQueue) as the source of an IObservable? Something like; Queue = new ConcurrentQueue<IMessage>(); var xs = Queue.AsEnumerable().ToObservable(); xs.Subscribe((IMessage msg) => { Console.WriteLine("Msg :" + msg.subject); }); I guess it doesn't ...

How can I take advantage of IObservable/IObserver to get rid of my "god object"?

In a system I'm currently working on, I have many components which are defined as interfaces and base classes. Each part of the system has some specific points where they interact with other parts of the system. For example, the data readying component readies some data which eventually needs to go to the data processing portion, the...

Why is ParallelQuery<T>.Where not working when converting to Observable ?

Hi folks, I have an observable collection that I want to process in parallel, then observe the processed values while filtering and finally subscribe a handler that receives the filtered values. My sample is syntactically correct and compiles just fine, and when I run the code, the Where statement doing the filtering is evaluated. Bu...

Rx in .Net 3.5 not Asynchronous?

I am playing with Rx in .Net3.5SP1 and trying the 101 Rx Samples. I am trying the first sample (Start - Run Code Asynchronously) but it doesn't seem to actually run asynchronously. For example, Console.WriteLine("[Creating]"); var o = Observable.Start(() => { Console.WriteLine("Calculating..."); ...

Silverlight localization with reactive framework. How to?

So, what is a best approach to implement silverlight localization with Reactive Framework (Rx) to achive on-the-fly UI changing? I would be very much obliged for examples. Here is an example of on-the-fly UI changing. But I can't figure out how it works. ...

How do you chain together two Asynchronous Operations with the Reactive Framework?

All I really want to do is complete two async operations, one right after the other. E.g. Download website X. Once that's completed, download website Y. ...

Allow duplicate generic types in ILMerge

Hi, according to the ILMerge documentation it allows to merge assemblies with conflicting types. I'm trying to merge FSharp.Core.dll and System.Reactive.dll but I can't figure out the command line params for this. ILMerge is complaining about the conflicting versions of System.IObservable<T>. How can I tell it to solve this conflict. ...

Chaining Observable Subscriptions

Is there a shorthand version of this. I want to call one sequence and then when it is finished call another. var seq1 = Observable.Range(1, 20); var seq2 = Observable.Range(21, 20); seq1.Subscribe( i => Console.WriteLine(i), () => seq2.Subscribe(i => Console.WriteLine(i))); ...