Search results for Reactive Framework - ThinqLinq by ThinqLinq

Search

ThinqLinq Samples on Github

When I first created this site, I used it both as a test bed for technologies as I played with them and as a repository for others to use for my presentations and other insights. Over the years people have been free to grab these samples, but haven’t had good ways of giving back to help improve the samples. In the mean time, there have been quite a number of technology changes. While I may have been late to the party on some, there’s only so many things one can focus on. One of the advances we’

Reactive Extensions RX in Action the movie

I’ve been giving presentations for some time now. By far, my favorite talk to give is my Reactive Extensions in Action. This past summer, I had the talk recorded at the Code on the Beach conference. If you haven’t had a chance to see it live, now’s your chance. The focus of this talk is to focus on some of the practical uses of Rx rather than the underpinnings of how it works. I hope you enjoy and this sparks ideas from you on how you can use it in your applications. Rx in Action recorded at C

Reactive Translator for RxJs

For several years, I’ve been demonstrating using Reactive Extensions to handle taking user input and providing real time translations into multiple languages. This code sample has been so popular that even Soma posted an example using the Bing translator in his introducing Rx post. In most cases, they only issue a single request or issue multiple individual requests for multiple languages. To add a bit of fun to my demo, I decided to spice it up a bit and turn the list of destination languages i

Rx for Windows Phone article now available

A couple of years ago I gave a presentation at the last MIX for doing asynchronous programming using Reactive Extensions (Rx) on the Windows Phone. The video of the presentation is still available for watching. Around the same time, I was approached by Code Magazine to write a similar article, which I was happy to oblige. It took a while but I was happy to see the article finally published in the Sep/Oct 2013 edition of Code Magazine. In the article I demonstrate how to use Rx to build a dice r

Multi Lingual LINQ and Rx

“Imitation is the sincerest [form] of flattery” – Charles Caleb Colton When dealing with technology, or nearly any other creative endeavor, one of the ways that you know if you’ve discovered a successful creation is to see how much it is embraced by not only your peers, but also your competitors. We can see this in quotes by Shakespeare, the music of Bach, parodies of Peter Schickle, Hip Hop sampling, and countless others. This blog is based on one of the more significant technologies that many

SignalR and Rx talk materials

Last night I gave a talk for the Gwinnett Georgia Microsoft User Group. There were plenty of questions and discussion. Everyone seemed interested in learning about SignalR at least even if most hadn’t heard of Rx (gasp.) The slides and demos from the presentation are available for download here. Update – 7/18/2014: The source code and slide deck is now available on Github for these projects. Head on over to https://github.com/jwooley/SignalrRxSamples to check them out. Anyway, for those that wa

New Paper.li for Reactive Extensions

Paper.li is a site that makes it easy to aggregate blog posts, twitter streams, Google+, Facebook, etc into a magazine format for easy reading. There are virtual papers on almost any topic you could imagine. While I’ve seen messages that some of my tweets and links have been featured, I didn’t recall seeing any on the Reactive Extensions (until Now). I took the liberty of creating a Paper.li specifically for tracking Reactive Extensions news and announcements. Feel free to follow it by clicking

SignalR and Reactive Extensions are an Rx for server push notifications

Recently, I had the need to build a system where multiple clients needed to be notified as changes happened on the server. While watching Damian Edwards, Brad Wilson and Levi Broderick present on Async in ASP.Net during the AspConf I was introduced to the dynamic simplicity that SignalR brings to the table. I was even more intrigued by the fact that it integrates directly with IObservable and the Reactive Extensions. After using it for a week, I’m truly impressed by what they’ve done with this l

Reactive Extensions books

I’ve been presenting on Rx for some time know. Often I’m asked when I’m going to write another book. I’ve considered writing one on Rx expanding on my blog posts here, but suspected that the market might be a bit small. At this point there are two books on the market for Rx. The first one is free and serves as a good resource to the Rx methods. Lee Campbell’s Introduction to Rx is a good overview of the various Reactive Extensions methods and coding techniqu

Using Rx to consume a Task based WCF service

Among the many changes that Dev 11 brings is the new default when adding a service reference to generate Task based proxy methods rather than using the APM flavor (using the BeginXXX – EndXXX model). In this post, we’ll look at creating a simple service and then consuming it using the Reactive Extensions. Let’s start by defining the service interface and implementation: Imports System.ServiceModel Imports System.Threading <ServiceContract()> Public Interface ISimpleServicesvc

Rx samples with WinRT

Recently I decided to rebuild one of my presentation computers using the Windows 8 Consumer Preview and Visual Studio 11 Beta. While it is working quite well for my typical usage, I did run into a bit of an issue when prepping my Rx talks for the Rocky Mountain Trifecta this past weekend. In the past, when I'm giving my Practical Rx talk, I show Silverlight, WPF, WP7 and RxJs samples. Unfortunately, the Windows 8 Consumer Preview does not support the Windows Phone 7 emulator and Visual St

Ix Interactive Extensions return

If you’ve been following the Reactive Extensions for any time, you may have seen that the team utilized the duality between IEnumerable and IObservable to not only create parallel extension methods of the enumerable versions on IObservable, but they also created IEnumerable versions of the additional methods that they added to IObservable as well. This formerly was in the Interactive libraries that came as part of the Rx bits. When the version 1 release of Rx came out however, these IEnumerable

Select Many with Rx and RxJs

A while back, I showed how you could use the query syntax and Rx to code a drag-drop operation similar to the way you might describe  the process to your mother. As a review, let’s take another look at the code, this time in C# as a preparation for moving it over to javaScript. var mouseDown = from evt in Observable.FromEventPattern<MouseButtonEventArgs>(image, "MouseLeftButtonDown") select evt.EventArgs.GetPosition(image); var mouseUp = Observable.FromE

devLINK RxJs and Async session materials available

I would like to thank everyone who came out to my DevLINQ sessions this week. The materials for both of the sessions are not available on the Files tab  of this site. In addition, here are the descriptions and direct links to each of these downloads: Reactive Extensions for JavaScript (RxJs) The Reactive Extensions allow developers to build composabile, asynchronous event driven methods over observable collections. In web applications, you can use this same model in client si

Using RxJs for an Image Rotator with jQuery

In trying to come up with some compelling demos for RxJs, I happened upon a scenario that some of you may find helpful. I wanted to create the ability to display images on a timer loop and keep looping through them while the user is on the page. I realize that there are a plethora of jQuery plugins that do this already, but  I have a new hammer (RxJs), I might as well see how well it works myself. As I did in my port of the ObservableSensor in the last RxJs post,  let’s start by defi

Cancelling a Reactive Extensions Observable

I’m often asked how do you cancel an Observable. In previous posts, I’ve shown how to stop observing by disposing the result of the subscription to the Observable. Of course, this isn’t the only way. If you are using one of the Observable.Generate methods, you can pass in a pointer to an object (like the System.Threading.CancellationTokenSource) and change a flag on that object, then in the iterate lambda function, reference that object to see if the cancellation flag was set. Here’s an example:

Porting Reactive Extension Samples to RxJs

In preparation for my upcoming talk at DevLink on RxJs, I decided to try porting some of my existing .Net/Silverlight samples over to the JavaScript version to see how different they would be. At this point, there is a disconnect between the .Net and .js versions and the signatures for the JavaScript methods are still lagging a bit behind. If you’re impatient and just want to see one of the samples in action, jump over to the Observable Sample to see how the sensor sample works and view code to

Revising the Reactive Sensor Generator

When first created the Reactive sensor sample I wasn't completely happy with it because if any of the various subscribers were disposed or triggered an OnCompleted (like the Any) clause, it would trigger a completed state to all of the other “listeners”. This is not what I intended.  To make it easy, let’s review how we created the sensor originally: Private _observers As New List(Of IObserver(Of SensorInfo)) Private _running As Boolean Public Function Subscribe(ByVal obs

Updating Reactive Samples to 10425 build

Today, I decided to take the plunge and update my WPF and Silverlight Reactive Extensions samples to the latest (at the time of this writing) build of Rx: version 1.1.10425.0. At this point, I have purposely left the phone samples on the blog targeting the original shipping bits, so they aren’t affected at this point. (ED: the 1.0.10605 stable and experimental releases shipped as of 6/5/2011. Looking at the release notes, this update appears to have much less breaking changes beyond those in the

Rx for WP7 on Telerik Wednesdays Webcast

For anyone who hasn’t had the opportunity to attend one of my in person presentations, or are frustrated by the audio quality of my MIX recording, join me on Wednesday, May 25 at 11:00 EST when I discuss using the Reactive Extensions on the Windows Phone as part of Telerik’s new Windows Phone 7 Wednesdays video series. Here’s the session details: Becoming an Rx Pusher on your Windows Phone with Jim Wooley on May 25th at 11am EST https://www1.gotomeeting.com/register/419991849 The Reac

Rx Mock Accelerometer using Observable.GenerateWithTime

When people ask about resources to learn how to use Rx on the Windows Phone, I often point them to the How to guides, including the How to: Use Reactive Extensions to Emulate and Filter Accelerometer Data for Windows Phone. Unfortunately, I have a problem with the underlying implementation of the emulation method which returns values through an iterator (yield) and IEnumerable<T> and then cast the IEnumerable to IObservable. As I pointed out in a MSDN forum post, It would be better to reco

Presenting Rx and Windows Phone 7 at Mix

I’m happy to have been selected to speak at MIX this year. This is an exciting conference combining developers and designers and focusing on increasing application User Experiences. The focus of my talk will be to show some practical uses of Rx in the context of the Windows Phone 7. If you’re going to attend MIX, I would love to see you at this session. Otherwise, the sessions are typically recorded. I’ll add a link to the recording once it becomes available. Here’s the session description as it

Using RX to detect shake Gestures

Part of the power of RX lies in it’s ability to compose complex operations  and keep the resulting code maintainable. I previously showed how to perform Drag-Drop operations with RX. This time, I want to take a look at a slightly more complex operation: Detecting “Shake” gestures on the Windows Phone 7. The phone includes the ability to detect motion in 3D space through the built-in Accelerometer in the Microsoft.Devices.Sensors library. This sensor raises events when the phone is moved w

Reactive Extensions responding to UI events

One of the great things about the Reactive Extensions is that they allow you to express rather complex interactions simply. For this example, we’ll consider the mouse drag drop operation in Silverlight. Note: The identical code works in both the web based Silverlight and the Windows 7 phone. If you want to download the phone version of this code, it is available in C# or VB. One of the indicators of simplicity is if you can explain a concept to your mother. How would you explain drag-drop to y

Reactive Extensions Phone 7 samples in VB

For a while, those of us who love Visual Basic have been struggling to make sure that newly released platforms include support for VB. When platforms that cater to the hobbyist, such as the new Windows Phone 7 tools are introduced without support for VB, we are particularly saddened. Happily, the team worked hard to overcome this shortcoming and announced today availability of the Windows Phone 7 tools in Visual Basic using Silverlight. You can download the tools now. In celebration of this opp

Reactive Framework Learning Resources for RxNet and RxJS

As I present more about the Reactive Framework, I often get people asking where they can learn more about it. Here are some resources that I’ve found useful: Rx center on the Data Developement Center (Start here for the bits) Hands on Labs: Rx .NET HOL C# Rx .NET HOL VB Rx JS HOL Rx Forum RxWiki (Samples and more) RX Videos on Channel 9 Matt Podwysocki’s blog (particularly for Rx JS) Introduction to Rx – Lee Campbell’s ebook. Of c

Reactive Framework Sorting it out

When I started looking at the Reactive Framework, one of the first things I did was to try creating some of the same standard LINQ queries that I’ve used against LINQ to Objects: Dim unsorted = From s In Sensor Where s.SensorType = "2" Order By s.SensorValue Select s If you try this where Sensor is an IObservable rather than IEnumerable, you will find that the Order By clause generates the following

Reactive Framework Subscribing to Events

Previously in my Reactive framework series, we saw how to create and subscribe to ongoing observable objects. While there are a number of cases where you would want to create your own observable type, often you simply want to compose reactive sequences in response to events raised by other means. Recently, I came across a simple example that can  show you how easy it is to subscribe to event and add functionality through the Reactive Framework’s extension methods. In this scenario, I neede

Reactive Framework as a Background Worker

In this introduction to the Reactive Framework series, we’ve spent a bit of time setting up our Observable and Observers and wiring them up. If you haven’t been following along, here’s links to the previous posts: Reactive Framework Why bother – Reactive Framework Building an IObservable Event Generator Reactive Framework Getting your LINQ on Reactive Framework Subscribing to Observables So far, our observers can listen to our sensor, but it turns out, we can’t know about it

Reactive Framework Subscribing to Observables

It’s been a while since I started the Reactive Framework series. In case you missed the earlier posts, here’s the links to what we’ve done so far: Reactive Framework Why bother – Identifying common scenarios solved by RX Reactive Framework Building an IObservable Event Generator – Generates random Observable values Reactive Framework Getting your LINQ on (Using LINQ over Observables) At this point, we’ve created our observer and set up the the logic that handles our OnNext values. What we hav

Reactive Framework Getting your LINQ on

Last time in our exploration of the Reactive Framework, we built a random Observable event generator. Now that we have our data source, we can start working with it. In the past, we would have hooked up event handlers to the event delegate and imperatively interacted with the values passed in the sender and EventArgs. Of course, when we Thinq LINQ, we try to find simpler, more declarative models to represent our intent. To start, we need to instantiate and start our event generator: Private

Reactive Framework Why bother

Now that LINQ has been out for a while, I’m starting to work on a new set of talks that are related to some of the new extensions to LINQ. Although LINQ to databases (SQL, Entity Framework, etc) are interesting, I’ve always been partial to the more generalized abstraction that is found in LINQ to Objects and XML. One of the most compelling expansions on the core LINQ concepts at this point is the Reactive Framework (rX). With the Reactive Framework, we flip the paradigm of Enumeration and pull

Reactive Framework Building an IObservable Event Generator

In my last post, I mentioned a number of cases where you may want to use the Reactive Framework. For some upcoming presentations, I wanted to focus on a couple of these scenarios, particularly on how you can use the Reactive Framework (rX) to work with events from device sensors. You can often find these kind of sensors in a number of industries, including Robotics, automated manufacturing systems, Medical monitors, Telecom usage, and Live financial feeds. In order to demonstrate using rX in thi