locked
Expression Trees RRS feed

  • Question

  • Hi,

          I've been playing about remoting observable sequences across any kind of transport (for my tests I'm just using sockets) where there would be a server with x clients where each client is subscribed to the server's stream and will receive onNext, onError, onComplete etc. I then realised it would be much nicer to use IQbservable and ship the built expression tree over to the server to run. I have managed to serialize the expression tree using http://expressiontree.codeplex.com/

     

    But now I'm stuck :P How do I turn an Expression object into something that I can plug into an observable stream on the server. 

     

    Do I need my own IQbservableProvider to do this?

    Is this what 'Linq to Anywhere' is going to be?

     

    I'm not even sure how this would work when the query contains something like

    from x in xs

    where x == SomeLocalProperty

    select x

     

    In this case I would have to serialize SomeLocalProperty over to the server for it to be executed. Presumably this kind of query just wouldn't be supported.

    Thursday, January 19, 2012 12:55 PM

All replies

  • EDIT (Nov. 18, 2012)
    See TCP Qbservable Provider in the Rxx project on CodePlex.

    ---------------

    Hi,

    According to Bart:

    "We've been playing around with expression tree serialization to remote or store queries. Stay tuned for more in this area!"

    In the meantime, you may find the following series of blog posts useful, although of course there are differences between IQueryable and IQbservable.

    http://blogs.msdn.com/b/mattwar/archive/2008/11/18/linq-links.aspx

    > In this case I would have to serialize SomeLocalProperty over to the server for it to be executed.
    > Presumably this kind of query just wouldn't be supported.

    Sure, it's similar to LINQ to SQL.  SQL Server can't execute against your application's local memory, so LINQ to SQL must limit the operators and expressions that it supports.

    - Dave


    http://davesexton.com/blog
    • Edited by Dave Sexton Sunday, November 18, 2012 4:52 PM Added link to Rxx
    Thursday, January 19, 2012 3:20 PM
  • IQueryable & IQbservable still seem to be dark arts for most. I would consider looking at Bart DeSmet's Video on IQbservable

    IQbservable on C9

    You may also be able to gleam something from his blog by going through the LINQ tagged posts. There seem to be a number of Expression tree related posts (on page 2 at least)

     

    HTH

    Lee


    Lee Campbell http://LeeCampbell.blogspot.com
    Thursday, January 19, 2012 3:33 PM
  • Cheers Lee, 

                          yeah that was the video that sparked my interest in the first place. I kind of guessed halfway through that this was really something that they'll be doing themselves (and no doubt will be doing much better than me!) so I'll probably just wait to see the fruits of their labour.

     

    Cathal

    Thursday, January 19, 2012 3:40 PM
  • Thanks Dave,

                             I didn't see that response from Bart, I probably would have aborted if I did! It was good fun to try though.

    Cheers,

    Cathal

    Thursday, January 19, 2012 3:43 PM
  • Stay tuned for more in this area. We've been working with other teams in our extended organization on building such facilities for a specific product (can't yet reveal more). In the future, we may generalize such tools - expression tree serialization in particular - and make them available as part of a future Rx release. There are a number of remaining though problems to solve first though.

    using (Microsoft.Sql.Cloud.DataProgrammability.Rx) { Signature.Emit("Bart De Smet"); }

    Monday, March 19, 2012 8:59 PM