1919
2020import rx .util .functions .Action0 ;
2121import rx .util .functions .Func0 ;
22+ import rx .util .functions .Func1 ;
23+ import rx .util .functions .Func2 ;
2224
2325/**
2426 * Represents an object that schedules units of work.
2527 */
2628public interface Scheduler {
2729
30+ /**
31+ * Schedules a cancelable action to be executed.
32+ *
33+ * @param state State to pass into the action.
34+ * @param action Action to schedule.
35+ * @return a subscription to be able to unsubscribe from action.
36+ */
37+ <T > Subscription schedule (T state , Func2 <Scheduler , T , Subscription > action );
38+
39+ /**
40+ * Schedules a cancelable action to be executed.
41+ *
42+ * @param action Action to schedule.
43+ * @return a subscription to be able to unsubscribe from action.
44+ */
45+ Subscription schedule (Func1 <Scheduler , Subscription > action );
46+
2847 /**
2948 * Schedules a cancelable action to be executed.
3049 *
@@ -43,6 +62,27 @@ public interface Scheduler {
4362 */
4463 Subscription schedule (Action0 action );
4564
65+ /**
66+ * Schedules a cancelable action to be executed in dueTime.
67+ *
68+ * @param state State to pass into the action.
69+ * @param action Action to schedule.
70+ * @param dueTime Time the action is due for executing.
71+ * @param unit Time unit of the due time.
72+ * @return a subscription to be able to unsubscribe from action.
73+ */
74+ <T > Subscription schedule (T state , Func2 <Scheduler , T , Subscription > action , long dueTime , TimeUnit unit );
75+
76+ /**
77+ * Schedules a cancelable action to be executed in dueTime.
78+ *
79+ * @param action Action to schedule.
80+ * @param dueTime Time the action is due for executing.
81+ * @param unit Time unit of the due time.
82+ * @return a subscription to be able to unsubscribe from action.
83+ */
84+ Subscription schedule (Func1 <Scheduler , Subscription > action , long dueTime , TimeUnit unit );
85+
4686 /**
4787 * Schedules an action to be executed in dueTime.
4888 *
0 commit comments