Rx Christmas Release 2010 - Introducing Join and GroupJoin operators (and more)
Build 1.0.2838.0 12/24/2010 – Rx Christmas Release 2010
Rx.NET
- New: support for joins in Rx. This includes two new operators, Join and GroupJoin, which have query expression support too:
This work will be covered on Channel 9 in much more detail. We’ll update this post with a link to the video when it’s online. Here’s the sketch of this new functionality.
Depending on the use of “into”, either Join or GroupJoin is being called in the following sample (see language specification for more details on the translation into query operator methods):
from x in xs
join y in ys on f(x) equals g(y) [into z]
…In the sample above, xs and ys are observable sequences. Furthermore, f(x) and g(y) are functions that return an observable sequence that denotes a duration. Results are produced when those observable sequences overlap. For example, one could monitor people entering and leaving a room and create a joined sequence that produces pairs of people that are in the same room at the same time.
Added a Window operator that uses joins underneath.
Reimplemented BufferWithTime, BufferWithCount, BufferWithTimeOrCount in terms of those new join and windowing operators.
- Generalized Publish family of operators (Publish, Prune, Replay) to a single Publish operator that takes in a Subject. Sharing a subscription to an observable sequence can be seen as “shadowing” the observable sequence using a Subject that can enforce different sharing policies (e.g. maintain history or not).
- Related to this work is the addition of a Multicast operator, which encapsulates a ConnectableObservable.
- ConnectableObservable is now parameterized in two generic type parameters, reflecting the most general ISubject.
- Added an overload to If that doesn’t take an “else” case observable sequence (defaulting to Observable.Empty).
- Fixes:
- DispatcherScheduler is now maintained on a per-thread basis using ThreadStatic.
- Refined implementation of Switch.
- Variance annotations on IAsyncEnumerable and IAsyncEnumerator for .NET 4.
RxJS
- Fix for scheduling in the Concat, Catch, and OnError operators.
- If operator can now be used without supplying an “else” case.
Ix.NET
- Fix to EnumerableEx.Scan.
Download the different release flavors here:
- Download Rx 1.0.2838.0 for .NET 3.5 SP1
- Download Rx 1.0.2838.0 for .NET 4
- Download Rx 1.0.2838.0 for Silverlight 3
- Download Rx 1.0.2838.0 for Silverlight 4
- Download Rx 1.0.2838.0 for JavaScript
- Download Rx 1.0.2838.0 for all common flavors
- Download Rx 1.0.2838.0 for XNA 4 XBOX 360
- Download Rx 1.0.2838.0 for XNA 3.1 Zune
- Download Rx 1.0.2838.0 for Windows Phone 7
Comments
Anonymous
January 07, 2011
Sometime between this release and the version I had been using, BufferWithTime changed from returning an IObservable<IList<T>> to returning an IObservable<IObservable<T>>. Now when I chain a Subscribe after BufferWithTime it seems to never be called. All I want are the values that came through during the time period in question. I assume I can do a ToEnumerable() on the inner IObservable, but again, my code never seems to get called. Any idea what I'm doing wrong? Some documentation on exactly what changed with this method and why would be nice, but I haven't found any at all. Guess I'm rolling back to the old version of the library for now...Anonymous
January 15, 2011
I have the same problem as Joel. this thread indicates that it should be fixed in the upcoming release: social.msdn.microsoft.com/.../5c45ae18-d195-4bfc-8ac1-3182d5883e8b However that post was made before this release so I am not sure what is going on with that.Anonymous
January 15, 2011
I have the same problem as Joel. this thread indicates that it should be fixed in the upcoming release: social.msdn.microsoft.com/.../5c45ae18-d195-4bfc-8ac1-3182d5883e8b However that post was made before this release so I am not sure what is going on with that.Anonymous
February 01, 2011
What happened to IObservable<T>.Replay() in this latest release?Anonymous
February 02, 2011
@Caleb - According to this thread, a fix is expected to be released around the end of the first week in February. Although a response on the blog would have been nice... social.msdn.microsoft.com/.../5f43b338-753d-4142-afd1-dd48d271a315Anonymous
April 27, 2011
I heard the new Rx would come today? (removing System.CoreEx etc..) Excited about it!Anonymous
May 08, 2011
The comment has been removedAnonymous
May 08, 2011
We will definitely fix that for the next release.