background preloader

Reactive Extensions

Facebook Twitter

Обзор Реактивных Расширений (Reactive Extensions, Rx) ReactiveUI. ReactiveProperty - MVVM Extensions for Rx. Using Reactive Extensions in Silverlight. This article is compatible with the latest version of Silverlight.

Using Reactive Extensions in Silverlight

This is part 1 of the series “Reactive Extensions in Silverlight”. 1. Introduction One of the coolest features which is part of .NET Framework and also available for Silverlight applications is the RX Framework. The arising interest around the RX Framework made me roll up my sleeves and start playing around this. Take a look at the next code snippet: How many times have you done this in your application?

What we have here is an implementation of the Iterator pattern (IEnumerable\IEnumerator). Now, if we take a look at the RX style collection, they are push collections. We are handling the MouseMove event. Introduction to Reactive Extensions for .net - Mr.Bool Courses. Mrbool Courses Featured Courses | Java courses | .Net Courses | Database courses | Web developer courses | Delphi courses Content Notes Discuss Mark as favorite 0. Rx - Reactive Extensions. Reactive Extensions for .NET ( “stuff happens” )

I’ve been taking a look at the Reactive Extensions for .NET. It’s early days for me at this point but I’m finding what I’m seeing to be really interesting. This is code that’s available from the DevLabs; and there are versions for .NET 3.5 Sp1, .NET 4.0, Silverlight 3, Silverlight 4 and also for JavaScript. The essence of the library is around consuming asynchronous and event-based work using observable collections that “push” items of interest at a composable set of observers. Update to post – I highly recommend the Hands On Labs for Rx which should be renamed “the instruction manual” I started with this video where Wes Dyer does a great job of drawing you in to the work that they’re doing; I found that there’s a point in this video where there’s a leap from 0 to 60 in 3-4 seconds as a couple of base concepts are suddenly expanded into the “drag and drop example” and it’s a little on the mind-bending side.

Extensions for Reactive Extensions (Rxx) Rx Wiki - Reactive Framework (Rx) Wiki. Make Async Your Buddy With Reactive Extensions. For a long time, good folks like Matt Podwysocki have extolled the virtues of Reactive Extensions (aka Rx) to me. It piqued my interest enough for me to write a post about it, but that was the extent of it. It sounded interesting, but it didn’t have any relevance to any projects I had at the time. Fortunately, now that I work at GitHub I have the pleasure to work with an Rx Guru, Paul Betts, on a project that actively uses Rx. And man, is my mind blown by Rx. Hits Me Like A Hurricane. A Generic Class for Wrapping Asynchronous Begin/End Operations, Using Reactive Extensions for .NET (Rx) Download source code - 118 KB Introduction One of the patterns you will come across as a .NET programmer is the Begin/End pattern for making asynchronous function calls.

The purpose of the pattern is to allow long-running operations to execute on a different thread than the calling thread, leaving the calling thread free (non-blocked) to continue execution. This is an important technique for building responsive GUIs, as well as for making remote calls effectively (whether you are calling a WCF service, using .NET remoting, accessing some REST-based Web Service, etc.). In case you haven't seen it before, it looks like this: IAsyncResult BeginOperation(...some number of parameters as input, AsyncCallback callback, object state); SomeResult EndOperation(IAsyncResult); While the BeginInvoke/EndInvoke pattern is powerful, it is awkward and non-intuitive to work with, especially if the EndOperation portion returns a value. Background Using the code. The Rx Framework By Example.

Introduction The Rx Framework is a very interesting and useful library recently released via DevLabs.

The Rx Framework By Example

The purpose of the framework is to provide a large framework for working with the Observer pattern. Reactive Extensions. 69 Entries Language(s) 18 minutes, 33 seconds 14 minutes, 26 seconds 42 minutes, 30 seconds 27 minutes, 42 seconds 19 minutes, 37 seconds 16 minutes, 28 seconds. Using Reactive Extensions for Streaming Data from Database. You have probably heard about Reactive Extensions, a library from Microsoft that greatly simplifies working with asynchronous data streams and allows to query them with LINQ operators.

There are many different scenarios where using rx results in a much more simple and flexible code. This post demonstrates how to use Reactive Extensions for loading data from database asynchronously in chunks. The Problem Recently I had to load data from SQLite database in grid view but the query was taking long time as there were hundreds of thousands of rows and the query was doing like %search term% filtering. The customer wanted to run the query in background and load data in chunks as they became available similar to SQL Server Management Studio. Solution without Reactive Extensions The most straightforward way to solve the problem is to call the method that reads the data in background thread and send the data to main thread when there are enough rows. First encounters with Reactive Extensions - Jon Skeet: Coding Blog. I've been researching Reactive Extensions for the last few days, with an eye to writing a short section in chapter 12 of the second edition of C# in Depth.

(This is the most radically changed chapter from the first edition; it will be covering LINQ to SQL, IQueryable, LINQ to XML, Parallel LINQ, Reactive Extensions, and writing your own LINQ to Objects operators.) I've watched various videos from Channel 9, but today was the first time I actually played with it. I'm half excited, and half disappointed. My excited half sees that there's an awful lot to experiment with, and loads to learn about join patterns etc. I'm also looking forward to trying genuine events (mouse movements etc) – so far my tests have been to do with collections. My disappointed half thinks it's missing something. Subscription model First, the way that subscription is handled for collections seems slightly odd. Genuine "event streams" which occur somewhat naturally – for instance, mouse movement events. Writing your first Rx Application. Reactive Extensions. About the Reactive Extensions Whether you are authoring a traditional desktop or web-based application, you have to deal with asynchronous and event-based programming from time to time.

Reactive Extensions

Desktop applications have I/O operations and computationally expensive tasks that might take a long time to complete and potentially block other active threads. Furthermore, handling exceptions, cancellation, and synchronization is difficult and error-prone. Using Rx, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quote, tweets, computer events, web service requests, etc.), and subscribe to the event stream using the IObserver<T> interface.

The IObservable<T> interface notifies the subscribed IObserver<T> interface whenever an event occurs.