本文整理汇总了Java中io.reactivex.plugins.RxJavaPlugins.onSchedule方法的典型用法代码示例。如果您正苦于以下问题:Java RxJavaPlugins.onSchedule方法的具体用法?Java RxJavaPlugins.onSchedule怎么用?Java RxJavaPlugins.onSchedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.reactivex.plugins.RxJavaPlugins
的用法示例。
在下文中一共展示了RxJavaPlugins.onSchedule方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: schedule
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
if (run == null) throw new NullPointerException("run == null");
if (unit == null) throw new NullPointerException("unit == null");
if (disposed) {
return Disposables.disposed();
}
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(handler, run);
Message message = Message.obtain(handler, scheduled);
message.obj = this; // Used as token for batch disposal of this worker's runnables.
handler.sendMessageDelayed(message, Math.max(0L, unit.toMillis(delay)));
// Re-check disposed state for removing in case we were racing a call to dispose().
if (disposed) {
handler.removeCallbacks(scheduled);
return Disposables.disposed();
}
return scheduled;
}
示例2: schedule
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
if (run == null)
throw new NullPointerException("run == null");
if (unit == null)
throw new NullPointerException("unit == null");
if (disposed) {
return Disposables.disposed();
}
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(run);
executeRunnable(title, delay, unit, scheduled);
// Re-check disposed state for removing in case we were racing a
// call to dispose().
if (disposed) {
return Disposables.disposed();
}
return scheduled;
}
示例3: schedule
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
if (run == null)
throw new NullPointerException("run == null");
if (unit == null)
throw new NullPointerException("unit == null");
if (disposed) {
return Disposables.disposed();
}
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(run);
executeRunnable(display, delay, unit, scheduled);
// Re-check disposed state for removing in case we were racing a
// call to dispose().
if (disposed) {
return Disposables.disposed();
}
return scheduled;
}
示例4: scheduleDirect
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit) {
if (run == null) throw new NullPointerException("run == null");
if (unit == null) throw new NullPointerException("unit == null");
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(handler, run);
handler.postDelayed(scheduled, Math.max(0L, unit.toMillis(delay)));
return scheduled;
}
示例5: scheduleDirect
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit) {
if (run == null)
throw new NullPointerException("run == null");
if (unit == null)
throw new NullPointerException("unit == null");
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(run);
executeRunnable(jobName, delay, unit, scheduled);
return scheduled;
}
示例6: scheduleDirect
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Disposable scheduleDirect(Runnable run, long delay, TimeUnit unit) {
if (run == null)
throw new NullPointerException("run == null");
if (unit == null)
throw new NullPointerException("unit == null");
run = RxJavaPlugins.onSchedule(run);
ScheduledRunnable scheduled = new ScheduledRunnable(run);
executeRunnable(display, delay, unit, scheduled);
return scheduled;
}