Generalized Publish family of operators - Can't mumble anonymous types
-
Thursday, December 30, 2010 3:06 PM
One problem with this new approach (for Prune & Publish, Replay etc)
xs.CombineLatest(ys, (x,y) => new{x,y}).Publish(new Subject<?>(), ...)
This with the specialized versions of Publish, Prune & Replay this was possible.
--------------------------------------------------------------------------------
James Miles http://enumeratethis.com
All Replies
-
Friday, December 31, 2010 6:42 AM
Hi James,
With the new model it is easy to create extension methods to provide replacement functionality, e.g.:
public static IObservable<T> PublishReplay<T>(this IObservable<T> source) { return source.Publish(new ReplaySubject<T>()); }
I do like the new ability to substitute different types of ISubject into Publish/Multicast.
One question though is whether the Rx "language" should incorporate some specific ISubject behaviours as well as the "routing" semantics of Publish. If not, then maybe Prune & Replay need to appear in a community contribution library, as valuable ways to solve a specific problem.
-
Friday, December 31, 2010 10:54 AM
>I do like the new ability to substitute different types of ISubject into Publish/Multicast.
I agree, it's more flexible.
James Miles http://enumeratethis.com -
Saturday, January 08, 2011 12:05 AM
Would it be useful to have factory methods since these can use type inference?
-
Sunday, January 09, 2011 11:04 AMI was thinking something like that, or if you're adding back the Prune/Replay/Publish methods it might not be a problem.
James Miles http://enumeratethis.com- Marked As Answer by fixedpoint Monday, January 10, 2011 10:31 PM
- Unmarked As Answer by fixedpoint Monday, January 10, 2011 10:31 PM
-
Monday, January 10, 2011 10:30 PM
In that case, we would probably just have Prune/Replay/Publish.
Otherwise, we would need to replace/augment every constructor with a factory method so that types can be properly inferred.
- Marked As Answer by fixedpoint Monday, January 10, 2011 10:31 PM

