12 | * This allows deregistering an {@link Subscriber} before it has finished receiving all events (i.e. before
13 | * onCompleted is called).
14 | */
15 | void unsubscribe();
16 |
17 | /**
18 | * Indicates whether this {@code Subscription} is currently unsubscribed.
19 | *
20 | * @return {@code true} if this {@code Subscription} is currently unsubscribed, {@code false} otherwise
21 | */
22 | boolean isUnsubscribed();
23 | }
24 |
--------------------------------------------------------------------------------
/box/src/main/java/cn/zengjingfang/box/android/rxhandler/rx/functions/Action.java:
--------------------------------------------------------------------------------
1 | package cn.zengjingfang.box.android.rxhandler.rx.functions;
2 |
3 | /**
4 | *
5 | * Created by ZengJingFang on 2018/4/25.
6 | */
7 |
8 | public interface Action extends Function {
9 | }
10 |
--------------------------------------------------------------------------------
/box/src/main/java/cn/zengjingfang/box/android/rxhandler/rx/functions/Action0.java:
--------------------------------------------------------------------------------
1 | package cn.zengjingfang.box.android.rxhandler.rx.functions;
2 |
3 | /**
4 | *
5 | * Created by ZengJingFang on 2018/4/25.
6 | */
7 |
8 | public interface Action0 extends Action {
9 |
10 | void call();
11 | }
12 |
--------------------------------------------------------------------------------
/box/src/main/java/cn/zengjingfang/box/android/rxhandler/rx/functions/Action1.java:
--------------------------------------------------------------------------------
1 | package cn.zengjingfang.box.android.rxhandler.rx.functions;
2 |
3 | /**
4 | * Created by ZengJingFang on 2018/4/27.
5 | */
6 |
7 | public interface Action1
14 | * The {@link Observable} will not call this method if it calls {@link #onError}.
15 | */
16 | void onCompleted();
17 |
18 | /**
19 | * Notifies the Observer that the {@link Observable} has experienced an error condition.
20 | *
21 | * If the {@link Observable} calls this method, it will not thereafter call {@link #onNext} or
22 | * {@link #onCompleted}.
23 | *
24 | * @param e
25 | * the exception encountered by the Observable
26 | */
27 | void onError(Throwable e);
28 |
29 | /**
30 | * Provides the Observer with a new item to observe.
31 | *
32 | * The {@link Observable} may call this method 0 or more times.
33 | *
34 | * The {@code Observable} will not call this method again after it calls either {@link #onCompleted} or
35 | * {@link #onError}.
36 | *
37 | * @param t
38 | * the item emitted by the Observable
39 | */
40 | void onNext(T t);
41 | }
42 |
--------------------------------------------------------------------------------
/box/src/main/java/cn/zengjingfang/box/android/rxhandler/rx/operators/OperatorSubscribeOn.java:
--------------------------------------------------------------------------------
1 | package cn.zengjingfang.box.android.rxhandler.rx.operators;
2 |
3 | import cn.zengjingfang.box.android.rxhandler.rx.Observable;
4 | import cn.zengjingfang.box.android.rxhandler.rx.Producer;
5 | import cn.zengjingfang.box.android.rxhandler.rx.Scheduler;
6 | import cn.zengjingfang.box.android.rxhandler.rx.Subscriber;
7 | import cn.zengjingfang.box.android.rxhandler.rx.functions.Action0;
8 |
9 | /**
10 | *
11 | * Created by ZengJingFang on 2018/4/27.
12 | */
13 |
14 | public class OperatorSubscribeOn