-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x: possible new operators based on RxJava's feature set #489
Comments
Here's a bookmark for some of the side-convo that is going on in the Slack channel. https://reactivex.slack.com/archives/C02B9R3QA/p1525433788000119 I'd appreciate if, over time as we figure out how to work together, less discussions happened on Slack and more on GitHub. It's early days of rebuilding the community, and right now so we don't need much structure but for progressing something like this more formal structure will be required. We definitely want to be conservative when adding operators and each one will need to be debated on merit in their own separate issue. We aren't ready for separate issues though. Let's use this thread as the baseline for bringing parity and discussions if we even need to do so (vs creating libraries) and how it could be done and when would be best to do it. You are doing a fantastic job. Thank-you for your help so far. Thank-you for doing this audit @akarnokd. |
I would like to propose yet another operator from RxJs, which I find highly useful with UI applications! |
@RivaCode. We have it as |
Can't say I agree. When, for example: |
As I mentioned in the Slack channel, thanks to C# extension methods, these or any other operator can live in any 3rd party library, outside of Rx.NET. The drawback is the possible difficulty of discovering them, the distrust of being non-standard or naming conflicts between multiple 3rd party extension methods. |
Added section about subjects in RxJava. |
Would it be possible to apply the performance improvments of |
It's |
I am hesitant about introducing the vocabulary of other Rx variants into the dotnet repo, since it will introduce ambiguity. For example, I think |
@glopesdev It probalby should be @akarnokd I see. So you would need some type variable in the type checks, which are not possible like (pseudo code): if (source is Select<x, y>.Selector && y is IObservable) ... |
@quinmars
In the case of |
Another way to think about this:
In a similar way, the In reactive world, there is many more things you can do with |
I'm aware of the meaning of I see that the concatenation of two verbs like in |
I think this really nails it 👍 i very much support the overload idea, no need to confuse people with more names that seem to imply new concepts |
Hmmm, although I still agree with @quinmars solution of adding an overload, I wanted to present another perspective into using the For me, what Basically I think it's equally valid to think about things this way, and as long as this perspective is made clear, and used consistently, I would still accept The selector overload idea is not too bad, but it will beg the question of why |
I think it'd be good to consider new operators on a case-by-case basis. So, I'd be all for seeing a set of issues that propose addition of operators in a more fine-grained manner. A few answers:
|
What we really need to move forward when adding new extensions is a code analysis of existing repositories to find out, which operators are most used. BTW, I would love to see feature parity with Rx.JS rather than Rx.Java as they are used much often. |
I've collected the operators and overloads of theirs which are available in RxJava but (likely) not in Rx.NET yet to enable discussions about feature synchronization.
Operators
combineLatestDelayError
concatDelayError
concatEager
concatEagerDelayError
error(Callable)
fromCallable
generate
intervalRange
mergeDelayError
switchOnNextDelayError
zip(delayError)
blockingIterable
blockingSubscribe
cache
collect
compose
concatMap
concat
. Can be implemented more efficiently thanconcat(map(source, f))
.concatMapDelayError
concatMapEager
concatEager
.concatMapEagerDelayError
concatMapIterable
concatMap
ping anIterable
turned into an observable.doAfterNext
doFinally
doOnDispose
doOnSubscribe
flatMap(delayError)
merge(map(source, f))
.forEachWhile
reduceWith
repeat(BooleanSupplier)
repeatWhen
retry(Predicate)
retry(BiPredicate)
retryUntil(BooleanSupplier)
retryWhen
sample(emitLast)
scanWith
switchIfEmpty
switchMap
switchOnNext(map(source, f))
.switchMapDelayError
takeUntil(Predicate)
observeOn(delayError)
unsubscribeOn
withLatestFrom(Observable...)
autoConnect
ConnectableObservable
after the specified number of observers have subscribed.refCount(n, time)
ConnectableObservable
after the specified number of observers have subscribed and/or disconnect after a grace period (under review).Subjects
RxJava has one additional subject type:
UnicastSubject
. It buffers items until one observer subscribes some time later and then drains the buffer into the observer.In addition,
Subject
s in RxJava have additional state-peeking methods available to all variants:hasObservers()
true
if there are currently any observers subscribed to the subject.hasComplete()
true
if the subject terminated normally.hasThrowable()
true
if the subject terminated exceptionally.getThrowable()
toSerialized()
onXXX
methods threadsafe to call from any thread.hasValue()
true
if aBehaviorSubject
orReplaySubject
have items in their buffer.getValue()
BehaviorSubject
.getValues()
ReplaySubject
.I'm not sure how interface evolution works in C#, so assuming it would break
System.Reactive.Interfaces
users, the methods could be added to a new interface derived fromISubject
or just onto the various RxSubject
types.The text was updated successfully, but these errors were encountered: