Comments (12)
I'm thinking now that Rxx's WindowIntrospective operator may in fact be another "dynamic" variant of ObserveOn. Although the scheduler doesn't vary, the size of the internal queue does.
See also: https://rx.codeplex.com/workitem/82
from reactive.
More details:
http://davesexton.com/blog/post/Reactive-Reactive-Read-all-about-it.aspx
from reactive.
Yup, obviously missing when we went through the operators.
from reactive.
I'm wondering how can you reasonably change, for example, the limit in Take
while it is running? I.e., you start out with a signal of 5, then change your mind and singal 3 as the limit. Now the source produces three items and stops when you are about to signal 7 as the new take limit...
The second problem is that the parameter signals may not be reusable and/or a single hot parameter source affects all Observers of the same assembled chain:
BehaviorSubject<int> takeLimit = new BehaviorSubject<int>();
Observable<int> o = Range(1, 10).Delay(TimeSpan.ofSeconds(1)).Take(takeLimit);
takeLimit.OnNext(5);
o.Subscribe(e => { });
takeLimit.OnNext(10); // will update the previous one's limit as well
o.Subscribe(e => { });
takeLimit.OnNext(1); // this too
o.Subscribe(e => { });
There is already a way of dynamically taking some items: TakeUntil
(and TakeWhile
if you have that).
from reactive.
TakeUntil
is the dynamic version of Take
. I go into a bit more detail in my blog post linked above.
from reactive.
@RxDave correct, just as SkipUntil
is a dynamic version of Skip
. So which operators should we consider here? The entire list? Note that we should backport RetryWhen
and RepeatWhen
from RxJava and RxJS to Rx .NET. @headinthebox thoughts?
from reactive.
@mattpodwysocki It's tough to say which would actually be useful without scenarios in mind. Merge
has a real-world scenario, so I'd say that's the most important one that I can think of.
Perhaps the heuristic should be to choose those operators that are stateful and will cause an irreversible loss of state when its arguments must change; e.g., when using Switch
to re-apply the operator with new arguments. Or at least, if avoiding state loss results in user code that solves the original problem that the operator was intended to solve in the first place, such as trying to dynamically adjust a Take
or Skip
query without the use of TakeUntil
or SkipUntil
, respectively.
from reactive.
Note that I generated that list of operators by simply looking for operators with scalar parameters. I didn't actually pay attention to the semantics or usefulness of such dynamic operators. It's possible that most of those operators wouldn't make much sense as dynamic operators. For example, I'm not so sure that ObserveOn<T>(this IO<T>, IO<IScheduler>>
makes sense. Worth considering though?
from reactive.
Doesn't make sense to me after these years.
from reactive.
Definitely nice to have but I have rarely felt the need, in most cases you can do pretty well with some Publish, WithLatestFrom and Switch although this is not optimal.
from reactive.
I agree it's rarely needed, but when it's needed it's actually necessary.
Reactive-Extensions#48
The problem is with any operators that may capture state, and whereby resubscribing loses that state. The current workarounds, perhaps, require us to redundantly implement the behavior of a problematic operator ourselves, defeating the entire purpose of the operator in the first place.
Operators that accept observables as arguments, especially only for some parameters, are immediately suspect.
from reactive.
Closing due to inactivity.
Still doesn't make sense to me after these years and doubt they can be implemented and used in a reasonable way. Not to mention, the explosion of the API surface.
from reactive.
Related Issues (20)
- Add BackOffRetry example in IntroToRx
- Fix sentence on IntroToRx book
- [Feature] GroupSequentialBy
- PageNotFoundError about https://www.reactiveui.net/slack HOT 2
- Referencing System.Reactive from a WinUI 3 app or library is causing XLS errors to display in VS while XAML files are open HOT 1
- Possible Deadlock in BehaviorSubject.Subscribe HOT 2
- Incorporate https://github.com/runceel/ReactiveProperty HOT 5
- Throttle breaks the observable chain while running on wasm in .net 8 HOT 5
- Issue with CancellationToken lifetime in Observable.Using (async version) HOT 1
- Window and Buffer operators omit items which are released immediately HOT 5
- Benchmarks don't run for .NET 6+
- TestScheduler WithAsync swallows all exceptions making all tests pass HOT 3
- Publish symbols for assemblies in this package HOT 1
- Union doesn't dispose enumerator for empty lists HOT 1
- IntroToRx recommends wrong Window overload
- Fully update Ix for .NET SDK 8.0 HOT 1
- Bug in Merge for USE_FAIR_AND_CHEAPER_MERGE HOT 4
- ToAsyncEnumerable_Observable_Cancel_InFlight sometimes fails spuriously
- Do operator can perform unexpected type conversion on observable sequence HOT 2
- Feature Request: Make `AsyncGate.LockAsync` cancellable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactive.