system.reactive

Using Reactive Extension for certain KeyPress sequences?

与世无争的帅哥 提交于 2019-12-24 04:02:06
问题 I am new .. or more precisely.. never used RX so I was wondering whether I can use it for this situation: I want to add a sort of Resharper Live Templates functionality to my app that allows users to enter short sequences of characters followed by a [Tab] and my app would replace the previously typed characters with the elsewhere specified, full text. Now I have a list of character arrays, each of them representing one possible sequence. I want some sort of stopwords/-keys that break the

Using Reactive Extension for certain KeyPress sequences?

≯℡__Kan透↙ 提交于 2019-12-24 04:02:00
问题 I am new .. or more precisely.. never used RX so I was wondering whether I can use it for this situation: I want to add a sort of Resharper Live Templates functionality to my app that allows users to enter short sequences of characters followed by a [Tab] and my app would replace the previously typed characters with the elsewhere specified, full text. Now I have a list of character arrays, each of them representing one possible sequence. I want some sort of stopwords/-keys that break the

combining one observable with latest from another observable

陌路散爱 提交于 2019-12-24 02:45:13
问题 I'm trying to combine two observables whose values share some key. I want to produce a new value whenever the first observable produces a new value, combined with the latest value from a second observable which selection depends on the latest value from the first observable. pseudo code example: var obs1 = Observable.Interval(TimeSpan.FromSeconds(1)).Select(x => Tuple.create(SomeKeyThatVaries, x) var obs2 = Observable.Interval(TimeSpan.FromMilliSeconds(1)).Select(x => Tuple.create

Rx produce and consume on different threads

两盒软妹~` 提交于 2019-12-24 02:41:35
问题 I have tried to simplify my issue by a sample code here. I have a producer thread constantly pumping in data and I am trying to batch it with a time delay between batches so that the UI has time to render it. But the result is not as expected, the produce and consumer seems to be on the same thread. I don't want the batch buffer to sleep on the thread that is producing. Tried SubscribeOn did not help much. What am I doing wrong here, how do I get this to print different thread Ids on producer

C# Reactive Extensions - Memory management and the Distinct operator

廉价感情. 提交于 2019-12-24 00:48:17
问题 Example code : public static IObservable<Order> ObserveOrders(this IProxy proxy,IEqualityComparer<Order> distinctPerDayComparer ) { return Observable.FromEvent<Order>(ev => proxy.OrderUpdated += ev,ev => proxy.OrderUpdated -= ev) .Distinct(distinctPerDayComparer); } public class DistinctPerDayComparer : IEqualityComparer<Order> { public bool Equals(Order o1, Order o2) { if(o1.Id != o2.Id) return false; bool isSameDay = o1.Date.Day == o2.Date.Day; return isSameDay; } public int GetHashCode

Cancel RX.Net Observer's ongoing OnNext methods

时光总嘲笑我的痴心妄想 提交于 2019-12-24 00:29:13
问题 As described in my original question (see Correlate interdependent Event Streams with RX.Net) I have an RX.net event stream that shall only call the observer's OnNext method as long as a certain other event is not triggered (basically 'Handle Change-* Events as long as the system is connected, pause while disconnected and re-start handling of the Change-* events once the system has re-connected). However, while this works smoothly with new events, how would I cancel / signal cancellation to

Is there a 'Hot' equivalent of Observable.Interval

半腔热情 提交于 2019-12-23 19:24:52
问题 If I do the following: var obs = Observable .Interval(TimeSpan.FromSeconds(1)) .Select(x => "A" + x.ToString()); obs .Subscribe(x => Console.WriteLine("From first: " + x.ToString())); Observable .Timer(TimeSpan.FromSeconds(3)) .SelectMany(_ => obs) .Subscribe(x => Console.WriteLine("From second: " + x.ToString())); I will get this after 4 seconds: From first: A0 From first: A1 From first: A2 From second: A0 From first: A3 Is there a 'Hot' equivalent to Observable.Interval that would produce

Get rid of Xamarin's “…you may need to supply runtime policy” warning

佐手、 提交于 2019-12-23 17:15:03
问题 In my Xamarin Mac project, I am seeing the following warning multiple times. I tried clearing the nuget cache, but it did not help me. Why is it shown and what is required to get it fixed? 来源: https://stackoverflow.com/questions/53452050/get-rid-of-xamarins-you-may-need-to-supply-runtime-policy-warning

RXJava - Split and Combine an Observable

十年热恋 提交于 2019-12-23 12:18:58
问题 I am new to RxJava and need some help/guidance on how to do the following: I need to get two values from an Observable a String a List<.ObjectA> I then need to apply two different filters() on this list and then finally combine all of them(String, FilteredListA, FilteredListB) into a single observable. Is there a single chained call I can use???(need example of groupBy maybe) Below is the sample code that is doing the same. MasterObject = String, List<.ObjectA> Observable<ReturnObject>

Quartz vs “Reactive Extensions”

限于喜欢 提交于 2019-12-23 12:18:54
问题 I am looking for a scheduling library for C# and for a long time I though the "only" option is Quartz.NET which is quite robust and work just fine. But when I found "Reactive Extensions" (RX - http://msdn.microsoft.com/en-us/data/gg577609) I realized that it can do Time-Related operations as well and have native .NET frontend. What are the limitations of Rx in terms of Time-Related operations? I need to fire tasks repeatedly in specific interval, after time period or so. And are there any