Skip to content
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

Lifting into a Subject #2458

Closed
abersnaze opened this issue Jan 15, 2015 · 9 comments
Closed

Lifting into a Subject #2458

abersnaze opened this issue Jan 15, 2015 · 9 comments

Comments

@abersnaze
Copy link
Contributor

Mildly interesting idea to see if there would be any interest.

public class Subject<T, R> extends Observable<R> implements Observer<T> {
    ...
    public <X> Subject<X, R> liftHead(final Operator<? extends T, ? super X> op) { ... }
    public <X> Subject<T, X> liftTail(final Operator<? extends X, ? super R> op) { ... }

    @Override
    public <X> Subject<T, X> lift(final Operator<? extends X, ? super R> op) { return liftTail(op); }
}
@akarnokd
Copy link
Member

akarnokd commented Feb 5, 2015

What do you want to achieve with this change?

@abersnaze
Copy link
Contributor Author

Up till now all the APIs that want to delegate part of the observable change chain to another piece of code has had to pass in the head as an argument. With these methods the delegate could return a subject the represents the some segment of the chain without any arguments.

For example retryWhen() takes a notification handler Func1<Observable<Exception>, Observable<?>>. With this it would have been possible for retryWhen to take a notification handler Func0<Subject<Exception, ?>

@akarnokd
Copy link
Member

akarnokd commented Feb 5, 2015

If I understand correctly, a chain of Subject<Integer, String> -> Subject<String, Date> -> Subject<Date, Long>, I can hand out each to different parties and observe them at any point?

@abersnaze
Copy link
Contributor Author

Yes. The Subject returned could be reused to subscribe() different source observables. The Subject would just be an capsulation of some computation without defining where the data comes from or where it is going to.

@benjchristensen
Copy link
Member

The encapsulation of computation sounds like the Transformer with Observable.compose.

@akarnokd
Copy link
Member

Do you still want to pursue this?

@benjchristensen benjchristensen added this to the 2.0 milestone Aug 28, 2015
@benjchristensen
Copy link
Member

Punting to 2.0 for bikeshedding.

@akarnokd
Copy link
Member

See #3975.

@akarnokd
Copy link
Member

I'm closing this as the PR implementing the proposed feature was not really endorsed by the OP after all. If you have further input on the issue, don't hesitate to reopen this issue or post a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants