Skip to content

Commit 5b9bca9

Browse files
committed
Introduce Subject as analogue to RX ISubject
1 parent 4cb4fed commit 5b9bca9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

rxjava-core/src/main/java/rx/subjects/PublishSubject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import rx.util.functions.Action1;
2020
import rx.util.functions.Func1;
2121

22-
public class PublishSubject<T> extends Observable<T> implements Observer<T> {
22+
public class PublishSubject<T> extends Subject<T, T> {
2323
public static <T> PublishSubject<T> create() {
2424
final ConcurrentHashMap<Subscription, Observer<T>> observers = new ConcurrentHashMap<Subscription, Observer<T>>();
2525

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package rx.subjects;
2+
3+
import rx.Observable;
4+
import rx.Observer;
5+
import rx.Subscription;
6+
import rx.util.functions.Func1;
7+
8+
public abstract class Subject<I, O> extends Observable<O> implements Observer<I> {
9+
protected Subject()
10+
{
11+
super();
12+
}
13+
14+
protected Subject(Func1<Observer<O>, Subscription> onSubscribe)
15+
{
16+
super(onSubscribe);
17+
}
18+
}

0 commit comments

Comments
 (0)