Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What do *you* use Rx for?

What do *you* use Rx for?

Scheduled Pinned Locked Moved C#
question
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SledgeHammer01
    wrote on last edited by
    #1

    Have a lull at work and heard cool things about Rx, so I started looking into it. I've only spent a few hours, but I don't get the point. I get that its "push" and "observable" "streams" of data... and I'm seeing there are kind of cool ways to process the streams (batches, timeouts, etc), but what are you guys using it for in the real world apps? All the samples I'm seeing are pretty much stock tickers and auto-complete text boxes.

    P 1 Reply Last reply
    0
    • S SledgeHammer01

      Have a lull at work and heard cool things about Rx, so I started looking into it. I've only spent a few hours, but I don't get the point. I get that its "push" and "observable" "streams" of data... and I'm seeing there are kind of cool ways to process the streams (batches, timeouts, etc), but what are you guys using it for in the real world apps? All the samples I'm seeing are pretty much stock tickers and auto-complete text boxes.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Probably the biggest thing I use it for in my codebase right now are watching model changes raised via INPC so that I can trigger dependent operations happening. I also have places that I'm using it for message filtering (not throttling), so I can have messages coming into one location which is injected into other models or ViewModels, and those classes can then pick out the messages they are interested in via the subscription. This gives me the option to easily do things like add logging for certain messages while ignoring others, and it's handled all in one place.

      S 1 Reply Last reply
      0
      • P Pete OHanlon

        Probably the biggest thing I use it for in my codebase right now are watching model changes raised via INPC so that I can trigger dependent operations happening. I also have places that I'm using it for message filtering (not throttling), so I can have messages coming into one location which is injected into other models or ViewModels, and those classes can then pick out the messages they are interested in via the subscription. This gives me the option to easily do things like add logging for certain messages while ignoring others, and it's handled all in one place.

        S Offline
        S Offline
        SledgeHammer01
        wrote on last edited by
        #3

        You mean something like: SomeViewModel : ViewModelBase { string SomeProp { get ... set ... } } and watching SomeProp from within SomeViewModel? Wouldn't you just add code to the setter? I guess breaking out the dependent task from the setter is "cleaner"... maybe? I do use an event aggregator for sending messages between VMs. Rx would provide some nifty features built in for batching, etc. I dunno, I write mostly business apps, so I'm having trouble wrapping my head around what a real world "stream" would be. Aside from stock tickers and auto complete lol. For logging, I just wrote something similiar to nLog that plays nice with my custom MVVM framework. Could you maybe describe a specific example from one of your apps where you were just like "Dang.. Rx was born to solve this"?

        P 1 Reply Last reply
        0
        • S SledgeHammer01

          You mean something like: SomeViewModel : ViewModelBase { string SomeProp { get ... set ... } } and watching SomeProp from within SomeViewModel? Wouldn't you just add code to the setter? I guess breaking out the dependent task from the setter is "cleaner"... maybe? I do use an event aggregator for sending messages between VMs. Rx would provide some nifty features built in for batching, etc. I dunno, I write mostly business apps, so I'm having trouble wrapping my head around what a real world "stream" would be. Aside from stock tickers and auto complete lol. For logging, I just wrote something similiar to nLog that plays nice with my custom MVVM framework. Could you maybe describe a specific example from one of your apps where you were just like "Dang.. Rx was born to solve this"?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          The scenario is this. We have one feed of data that contains many different types of messages in it. Each of these messages is handled by a different ViewModel because of the way that the screens work. So, each ViewModel "subscribes" to the appropriate message in the model via RX (it's the same model across all of the VMs), and picks out the messages it needs. We have extended RX slightly so that we can shape the data as well - some of the VMs actually take moving aggregates out of the underlying model data. And yes, "dang, RX was born to solve this".

          S 1 Reply Last reply
          0
          • P Pete OHanlon

            The scenario is this. We have one feed of data that contains many different types of messages in it. Each of these messages is handled by a different ViewModel because of the way that the screens work. So, each ViewModel "subscribes" to the appropriate message in the model via RX (it's the same model across all of the VMs), and picks out the messages it needs. We have extended RX slightly so that we can shape the data as well - some of the VMs actually take moving aggregates out of the underlying model data. And yes, "dang, RX was born to solve this".

            S Offline
            S Offline
            SledgeHammer01
            wrote on last edited by
            #5

            Are you "allowed" to say what type of data it is / business domain? That's the part I'm trying to figure out LOL. Aside from the shaping, what you described above is event aggregator. Everybody always uses the stock ticker to explain RX. That you might get 20 ticks / sec, but for display purposes, you only need 5 / sec or whatever. So yeah, RX will help you out there... I guess I'm just trying to find some real examples besides the stock ticker. One example I found yesterday was for throttling emails. That's all well and good, but you don't generally throttle emails in the real world. Maybe getting a data feed from a hardware device but I don't work with hardware...

            P 1 Reply Last reply
            0
            • S SledgeHammer01

              Are you "allowed" to say what type of data it is / business domain? That's the part I'm trying to figure out LOL. Aside from the shaping, what you described above is event aggregator. Everybody always uses the stock ticker to explain RX. That you might get 20 ticks / sec, but for display purposes, you only need 5 / sec or whatever. So yeah, RX will help you out there... I guess I'm just trying to find some real examples besides the stock ticker. One example I found yesterday was for throttling emails. That's all well and good, but you don't generally throttle emails in the real world. Maybe getting a data feed from a hardware device but I don't work with hardware...

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              It's data for the emergency services. Typically, we could see about 40 to 50K messages every 10 seconds. Different parts of the application suite need different parts of these messages.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups