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

Observer + Subscriber #793

Merged
merged 6 commits into from
Jan 31, 2014

Conversation

benjchristensen
Copy link
Member

As per discussion in #792 the abstract class Observer has been returned to interface Observer and there is now abstract class Subscriber implements Observer<T>, Subscription to fill that role.

Signatures are now:

// Observable.create
public final static <T> Observable<T> create(OnSubscribe<T> f)

// Observable.OnSubscribe typed function interface
public static interface OnSubscribe<T> extends Action1<Subscriber<? super T>>

// Observable.subscribe
public final Subscription subscribe(Subscriber<? super T> subscriber)
public final Subscription subscribe(Observer<? super T> observer)

// lift function
public <R> Observable<R> lift(final Func1<Subscriber<? super R>, Subscriber<? super T>> bind)

// Observer
public interface Observer<T> {
     public abstract void onNext(T t);
     public abstract void onError(Throwable e);
     public abstract void onCompleted();
}

// Subscriber
public abstract class Subscriber<T> implements Observer<T>, Subscription {
     public final void add(Subscription s)
     public final void unsubscribe()
     public final boolean isUnsubscribed()
}

// Subject 
public abstract class Subject<T, R> extends Observable<R> implements Observer<T>

-> Restore Observer interface
-> Subscriber implements Observer, Subscription
- rxjava-core is passing all unit tests
- other modules are failing
@cloudbees-pull-request-builder

RxJava-pull-requests #715 SUCCESS
This pull request looks good

benjchristensen added a commit that referenced this pull request Jan 31, 2014
@benjchristensen benjchristensen merged commit 025de00 into ReactiveX:master Jan 31, 2014
@benjchristensen benjchristensen deleted the subscriber-observer branch January 31, 2014 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants