system.reactive

RX: Best approach to async download a list of something from a WCF-service?

只愿长相守 提交于 2020-01-06 15:06:48
问题 The result Im after is a list (WPF) of items that is populated one at a time async from a web service (WCF). I figured RX could be a good option for this? My web service method is returning an array of strings (for now) and at the client-side Im using: var list = Observable.FromAsyncPattern<string[]>(client.BeginList, client.EndList); But now what? Im not familiar with RX at all and I feel very lost. Anyhow I guess my web service has to stream the list instead of sending it in a chunk if I

Left mouse button click detect on winform using Reactive extensions IObservable on events

*爱你&永不变心* 提交于 2020-01-06 14:01:31
问题 Just started reading on Reactive extensions. I am trying to watch a simple left mouse button click on my winform. Meaning anywhere there is a click (on any control on the form including the form) I just want to display a message "Click detected". So far I have var mouseDown = Observable.FromEvent<MouseButtonEventArgs>(frmMain, "MouseDown"); //missing code please fill here mouseDown.Subscribe(() => Debug.WriteLine("left click detected."); I know the first line will detect any mouse event. I

Left mouse button click detect on winform using Reactive extensions IObservable on events

 ̄綄美尐妖づ 提交于 2020-01-06 13:59:05
问题 Just started reading on Reactive extensions. I am trying to watch a simple left mouse button click on my winform. Meaning anywhere there is a click (on any control on the form including the form) I just want to display a message "Click detected". So far I have var mouseDown = Observable.FromEvent<MouseButtonEventArgs>(frmMain, "MouseDown"); //missing code please fill here mouseDown.Subscribe(() => Debug.WriteLine("left click detected."); I know the first line will detect any mouse event. I

Correlate interdependent Event Streams with RX.Net

冷暖自知 提交于 2020-01-06 13:58:53
问题 I have a class that has, among others, the three following events: DataSourceLoaded DataSourceUnloaded DataSourceFieldChanged Right now I am using RX.Net in combination with its .Throttle() 'ing functionality to slow down handling of burst / frequent incoming events as I only need to know IF something changed recently, not every single occurrence is relevant to me. The part that I have a bit of problems with is that the underlying datasource may be added/removed at any time and the handler of

Correlate interdependent Event Streams with RX.Net

删除回忆录丶 提交于 2020-01-06 13:58:32
问题 I have a class that has, among others, the three following events: DataSourceLoaded DataSourceUnloaded DataSourceFieldChanged Right now I am using RX.Net in combination with its .Throttle() 'ing functionality to slow down handling of burst / frequent incoming events as I only need to know IF something changed recently, not every single occurrence is relevant to me. The part that I have a bit of problems with is that the underlying datasource may be added/removed at any time and the handler of

Converting a MEF application to utilize Rx (System.Reactive)

穿精又带淫゛_ 提交于 2020-01-06 08:10:22
问题 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 The VS solution has a UI project (default StartUp

Rx.Net multiple Mergerd Observables & Throttle() not working as expected

折月煮酒 提交于 2020-01-06 07:04:54
问题 I have multiple source Obserables that emit Unit.Default instances merged into one stream and the later being .Throttle()'ed to yield a result after 300ms of 'silence' var columnVisibilityChangedObservable = Observable.FromEventPattern<ColumnVisibilityChangedEventArgs>( handler => this.ColumnVisibilityChanged += handler, handler => this.ColumnVisibilityChanged -= handler) .Select(_ => Unit.Default); var dataBindingCompleteObservable = Observable.FromEventPattern

Should I always dispose subscriptions of observables?

我的梦境 提交于 2020-01-06 06:01:07
问题 Should I always dispose observables when the ViewModel automatically goes out of scope and no reference to other classes is maintained? A little example: public class TestViewModel : ReactiveObject { public TestViewModel() { MyList = new ReactiveList<string>(); MyList.ChangeTrackingEnabled = true; //Do I have to dispose/unsubscribe this? MyList.ItemChanged.Subscribe(_ => ...); //Or this? this.WhenAnyValue(x => x.MyList).Subscribe(_ => ...); } ReactiveList<string> _myList; public ReactiveList

Infinite IObservable from Task function and toggle observable

好久不见. 提交于 2020-01-05 04:06:08
问题 I have two things : Function that returns Task<TResult> query and IObservable<bool> toggle . What I want to create is IObservable<TResult> that when toggle gets true , it start an infinite loop where it calls query every time and returns it's result. Then, when toggle gets false , it should stop the infinite loop. I did read how to make an infinite loop from task, but I cannot figure out how to toggle it on and off. Also, it cannot run the query in infinite loop and just filter it. It should

Does .Net Reactive Extensions Framework (Rx) takes topological order into consideration?

懵懂的女人 提交于 2020-01-05 02:36:14
问题 Does the .Net Reactive Extensions Framework propagates the notifications in topological order to minimize the amount of updates? Like Scala Rx does: Does .Net Reactive Extensions (Rx) ta 回答1: .NET Rx uses several semantics while implementing FRP. The key point are the observables and subscriber contexts, especially the schedulers used by subscribers. TL;DR - .NET RX does not use topological order while invoking notifications. The long answer: subscibers are invoked by order of their