system.reactive

Observable.Interval not updating UI with expected frequency

北战南征 提交于 2019-12-25 17:06:29
问题 I am trying to simulate the behavior of a clock. For that, I create an Observable.Interval that, after a specified time interval, updates the value of a property by the equivalent amount of time. The value is data-bound to the GUI. The problem is: the "clock" runs quite slower than expected, that is, it takes longer than one second for the clock value to increase one second. The finer the desired time resolution (the value of MILLIS_INTERVAL below), the worse the problem gets (I tested it

Observable.Interval not updating UI with expected frequency

梦想的初衷 提交于 2019-12-25 17:06:10
问题 I am trying to simulate the behavior of a clock. For that, I create an Observable.Interval that, after a specified time interval, updates the value of a property by the equivalent amount of time. The value is data-bound to the GUI. The problem is: the "clock" runs quite slower than expected, that is, it takes longer than one second for the clock value to increase one second. The finer the desired time resolution (the value of MILLIS_INTERVAL below), the worse the problem gets (I tested it

Infinite IObservable from Task function and toggle observable with parameters

人走茶凉 提交于 2019-12-25 09:34:43
问题 This is follow up question to : Infinite IObservable from Task function and toggle observable Above question asks if it is possible to create a repeating IObservable<TResult> from IObservable<bool> toggle and Task<TResult> query , so that query is called repeatedly if last toggle was true and not called at all if last toggle is false . That seems to be pretty easily achieved using Defer and Switch methods. But that has problem, because the query is not parametrized. Concretely, there are two

ReactiveUI 7.0 how to handle with observables that are disposed when exception is thrown

自闭症网瘾萝莉.ら 提交于 2019-12-25 08:37:50
问题 I'm really starting to dig this rx thing... Basically, I am following along with this video just to teach myself more about ReactiveUI before I start using it for real! I am trying to create a situation when we use WhenAnyValue to perform a throttled search-as-you-type. And, if the search function throws an exception, I want to set a property on the view model called IsError (so I can show an X or something). This the important parts of the ViewModel I have working: public ReactiveCommand

Making MEF plugins work with Rx

和自甴很熟 提交于 2019-12-25 08:14:03
问题 So the current situation is I have a program that is completely utilizing MEF. Now I want to make it utilize Rx as to allow it to scale to larger queries and allow the user to look over results as the various plugins return results. It is currently setup as such: Workflow: Query => DetermineTypes => QueryPlugins => Results Currently the code is all stored on GitHub if anyone needs to reference more than what I post below. ALeRT on GitHub With the help of @Enigmativity the primary portion is

Building a Sensor Monitoring System using RX

偶尔善良 提交于 2019-12-25 07:13:00
问题 See Merging multiple custom observables in RX for background. My scenario is that I have a number of arbitrary sensors (hardware). I have written some pluggable modules that can connect to these sensors in C#. They currently each use a thread to run an acquisition routine on a timer. The larger goal is to change polling to RX as well once I understand how! There is a requirement to monitor these sensors in groups so I was thinking there would be an aggregated topic where a monitor could

Windows Service just stops. No messages, no alerts, errors, warning - nothing

与世无争的帅哥 提交于 2019-12-25 05:14:20
问题 I have a Windows service that just silently stops on its own. Here is the relevant code: OnStart() method: protected override void OnStart(string[] args) { try { InitializeLogging(); // we don't DO command line arguments if (args.Length > 0) { eventLog.WriteEntry("All command line arguments are ignored. You must edit the app.config file manually to make changes to what watchers are run."); throw new ArgumentException("Command line arguments are ignored."); } ReadAppConfig();

Self-error-dependent self-disposal of IObservable subscriptions

霸气de小男生 提交于 2019-12-25 05:04:26
问题 I have F# code that looks like this: module O = Control.Observable //... use ss = serve' 4000 |> O.subscribe (fun c -> use cs = RSS.items |> O.subscribe (bytes >> c.SendAll) |> ignore) where serve' : int -> IObservable<Socket> c : Socket RSS.items : IObservable<XElement> bytes : XElement -> byte [] c.SendAll : byte [] -> unit What is the most idiomatic way to retain cs until c.SendAll fails? Is there or is it possible to define Observable.subscribeUntilError(action) where if action fails,

Merging multiple custom observables in RX

女生的网名这么多〃 提交于 2019-12-25 04:32:11
问题 Trying to model a system sending out notifications from a number of publishers using RX. I have two custom interfaces ITopicObservable and ITopicObserver to model the fact that the implementing classes will have other properties and methods apart from the IObservable and IObserver interfaces. The problem I have is that my thinking is I should be able to add a number of observables together, merge them together and subscribe to an observer to provide updates from all merged observables.

Toggling between values while producing events on timer

会有一股神秘感。 提交于 2019-12-25 04:13:49
问题 I'm playing with using the Rx in an XNA proof-of-concept, and I've run into a bit of an obstacle composing some queries that I'm hoping you folks can assist me with understanding how some of these operators work. In my POC, I would like the player's score to increment only while there is not an active drag operation occurring. In addition, there is a 'grab gauge' that I would like to deplete whenever there is an ongoing drag, and fill whenever there isn't. Finally, if a drag operation is