|
The February edition of Dr. Dobb's Journal is running an article on Continuous LINQ and I thought it would be appropriate to get the source code for CLINQ published so that people reading the magazine might be able to download the code :)
As a result, I've created a new CodePlex project right here: http://www.codeplex.com/clinq. The source code is available here as well as a downloadable ZIP file containing it all. I will be uploading some demo applications to the site within the next few days.
As you may or may not already know, CLINQ is a library that allows you to use the LINQ syntax to write queries against continually changing result sets. These result sets can be changing for any number of reasons, including (but not limited to), network messages being received, events being fired, or even triggers being hit from databases.
For example, you could write queries that looks like this:
var msftTicks = from tick in MarketData.Ticks
where tick.Price < 100 && tick.Price > 80 && tick.Symbol == "MSFT"
select tick;
var appleTicks = from tick in MarketData.Ticks
where tick.Symbol == "AAPL"
select tick;
Using conventional LINQ, you would have to create some kind of timer to re-run this query and then re-bind the data to your GUI so that your system stays in sync with the flood of traffic coming in from your market data feed. Using CLINQ, however, you could have a single background thread that is maintaining the MarketData.Ticks collection from the incoming network messages, and all of your GUI can be bound to CLINQ queries which are updating themselves constantly as data in the underlying collection changes.
I've got a couple demos cooking that use WCF to transmit network messages and I've got a console app monitoring one query and 2 WPF apps that are monitoring 2 different queries. They don't use timers, they don't use polling loops, and they don't use semaphores - all of the updating is continuous and thread-safe.
Great, I've been waiting for this. Interesting to see how you did it.