开发者

Usage of Reactive Extensions in the "Real World" [duplicate]

开发者 https://www.devze.com 2023-02-23 13:57 出处:网络
This question already has answers here: Good example of Reactive Extensions Use [closed] (6 answers) Good introduction to the .NET Reactive Framework [closed]
This question already has answers here: Good example of Reactive Extensions Use [closed] (6 answers) Good introduction to the .NET Reactive Framework [closed] (16 answers) 开发者_StackOverflow中文版 Closed 9 years ago.

In order to get familiar with RX, I am looking for examples where RX is used in "real world" projects.

I am interested in both, the .NET version or the JavaScript version. References to closed source projects would be interesting. Open-source projects would be even more interesting.

It would also be interesting why RX is a good choice for those projects.

I am not looking for tutorials or introductions.


In less than an hour I was able to add Rx support to MassTransit, an open source ESB:

https://github.com/MassTransit/MassTransit/tree/master/src/MassTransit.Reactive

Update: As for why it's a good fit, they already had a Subscribe/Unsubscribe mechanism in place. Adding Rx support means that those subscriptions can now be composed together easily. For example, you might have two kinds of messages that share some CorrelationId. With Rx you can trivially Join() the published messages by that identifier:

var someMessages = bus.AsObservable<SomeMessage>();
var otherMessages = bus.AsObservable<AnotherMessage>();

var joined = from s in someMessages
             join o in otherMessages
               on s.CorrelationId equals o.CorrelationId
             select new { s.Something, o.OtherThing };

joined.Subscribe(x => Console.WriteLine(x));

Also: Check out https://github.com/reactiveui/ReactiveUI for an Rx-powered MVVM framework targeting XAML (WPF, Silverlight, WP), iOS and Android. Very, very cool stuff.


Here are two closed source/commercial examples:

  1. Banks are using Rx adapters over their message bus infrastructures.

  2. The makers of Nirvana, a web streaming product will be offering an based API in their next release of the product.

0

精彩评论

暂无评论...
验证码 换一张
取 消