c# - Reactive Extensions SelectMany and Concat -
I understand that the behavior of SelectMany is to effectively merge the result of each value produced in a single stream, so that Nondeterministic
How do I do somehow in C # in RCJs.
var obs = Observable.Range (1, 10). Selection Mono (x = & gt; {Return Overview. Intervals (Timespace: Formsconds (10 - x)). Lo (3);}). Conceat (); This is what I want to do effectively, looking at a range, in order for each one to wait a bit so that they start. It is obviously a toy example but this idea is << P>
Use select , not SelectMany . concat overload which you can call a IObservable & lt; IObservable & lt; T & gt; & Gt; If you want to use the work on , then just project internal scenes, do not flatten them. var obs = Observable.Range (1, 10). Select (x => Observable.Interval (TimeSpan.FromSeconds (10 - x)). Take (3)) .Concat (); Note that each interval is deferred by using subscrition concat ; That is, when you subscribe, the first interval starts immediately, but all the remaining intervals are generated and are unencrypted without subscription. Do not like it concat subscribe to everything and then run the value again in the correct sequence later.
Comments
Post a Comment