You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Why is this an abstract class instead of an interface?
37
+
* <p>
38
+
* <ol>
39
+
* <li>Java doesn't support extension methods and there are many overload methods needing default implementations.</li>
40
+
* <li>Virtual extension methods aren't available until Java8 which RxJava will not set as a minimum target for a long time.</li>
41
+
* <li>If only an interface were used Scheduler implementations would then need to extend from an AbstractScheduler pair that gives all of the functionality unless they intend on copy/pasting the
42
+
* functionality.</li>
43
+
* <li>Without virtual extension methods even additive changes are breaking and thus severely impede library maintenance.</li>
44
+
* </ol>
25
45
*/
26
-
publicinterfaceScheduler {
46
+
publicabstractclassScheduler {
47
+
48
+
/**
49
+
* Schedules a cancelable action to be executed.
50
+
*
51
+
* @param state
52
+
* State to pass into the action.
53
+
* @param action
54
+
* Action to schedule.
55
+
* @return a subscription to be able to unsubscribe from action.
Copy file name to clipboardExpand all lines: rxjava-core/src/main/java/rx/concurrency/CurrentThreadScheduler.java
+16-11Lines changed: 16 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -24,51 +24,55 @@
24
24
importorg.junit.Test;
25
25
importorg.mockito.InOrder;
26
26
27
+
importrx.Scheduler;
27
28
importrx.Subscription;
28
29
importrx.util.functions.Action0;
29
-
importrx.util.functions.Func0;
30
+
importrx.util.functions.Func2;
30
31
31
32
/**
32
33
* Schedules work on the current thread but does not execute immediately. Work is put in a queue and executed after the current unit of work is completed.
Copy file name to clipboardExpand all lines: rxjava-core/src/main/java/rx/concurrency/DiscardableAction.java
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -17,27 +17,31 @@
17
17
18
18
importjava.util.concurrent.atomic.AtomicBoolean;
19
19
20
+
importrx.Scheduler;
20
21
importrx.Subscription;
21
22
importrx.util.AtomicObservableSubscription;
22
-
importrx.util.functions.Func0;
23
+
importrx.util.functions.Func1;
24
+
importrx.util.functions.Func2;
23
25
24
26
/**
25
27
* Combines standard {@link Subscription#unsubscribe()} functionality with ability to skip execution if an unsubscribe occurs before the {@link #call()} method is invoked.
0 commit comments