本文整理汇总了Java中rx.internal.schedulers.ScheduledAction.addParent方法的典型用法代码示例。如果您正苦于以下问题:Java ScheduledAction.addParent方法的具体用法?Java ScheduledAction.addParent怎么用?Java ScheduledAction.addParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.internal.schedulers.ScheduledAction
的用法示例。
在下文中一共展示了ScheduledAction.addParent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (compositeSubscription.isUnsubscribed()) {
return Subscriptions.unsubscribed();
}
action = RxAndroidPlugins.getInstance().getSchedulersHook().onSchedule(action);
final ScheduledAction scheduledAction = new ScheduledAction(action);
scheduledAction.addParent(compositeSubscription);
compositeSubscription.add(scheduledAction);
handler.postDelayed(scheduledAction, unit.toMillis(delayTime));
scheduledAction.add(Subscriptions.create(new Action0() {
@Override public void call() {
//Log.e(TAG, "HandlerScheduler has unsubscribed");
handler.removeCallbacks(scheduledAction);
}
}));
return scheduledAction;
}
示例2: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (compositeSubscription.isUnsubscribed()) {
return Subscriptions.unsubscribed();
}
action = RxAndroidPlugins.getInstance().getSchedulersHook().onSchedule(action);
final ScheduledAction scheduledAction = new ScheduledAction(action);
scheduledAction.addParent(compositeSubscription);
compositeSubscription.add(scheduledAction);
handler.postDelayed(scheduledAction, unit.toMillis(delayTime));
scheduledAction.add(Subscriptions.create(new Action0() {
@Override
public void call() {
handler.removeCallbacks(scheduledAction);
}
}));
return scheduledAction;
}
示例3: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(final Action0 action, long delayTime, TimeUnit unit) {
final ScheduledAction scheduledAction = new ScheduledAction(action);
scheduledAction.add(Subscriptions.create(new Action0() {
@Override
public void call() {
handler.removeCallbacks(scheduledAction);
}
}));
scheduledAction.addParent(compositeSubscription);
compositeSubscription.add(scheduledAction);
handler.postDelayed(scheduledAction, unit.toMillis(delayTime));
return scheduledAction;
}
示例4: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit timeUnit) {
final ScheduledAction scheduledAction = new ScheduledAction(action);
scheduledAction.addParent(compositeSubscription);
compositeSubscription.add(scheduledAction);
final int taskId = BukkitRxScheduler.scheduleOnBukkitScheduler(plugin, scheduledAction, timeUnitToBukkitTicks(delayTime, timeUnit), concurrencyMode);
scheduledAction.add(Subscriptions.create(new Action0() {
@Override
public void call() {
plugin.getServer().getScheduler().cancelTask(taskId);
}
}));
return scheduledAction;
}
示例5: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (innerSubscription.isUnsubscribed()) {
// don't schedule, we are unsubscribed
return Subscriptions.empty();
}
ScheduledAction s = worker.scheduleActual(action, delayTime, unit);
innerSubscription.add(s);
s.addParent(innerSubscription);
return s;
}
示例6: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (innerSubscription.isUnsubscribed()) {
// don't schedule, we are unsubscribed
return Subscriptions.empty();
}
ScheduledAction s = (ScheduledAction)innerWorker.schedule(action, delayTime, unit);
innerSubscription.add(s);
s.addParent(innerSubscription);
return s;
}
示例7: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (innerSubscription.isUnsubscribed()) {
// don't schedule, we are unsubscribed
return Subscriptions.empty();
}
ScheduledAction s = threadWorker.scheduleActual(action, delayTime, unit);
innerSubscription.add(s);
s.addParent(innerSubscription);
return s;
}
示例8: schedule
import rx.internal.schedulers.ScheduledAction; //导入方法依赖的package包/类
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (innerSubscription.isUnsubscribed()) {
// don't schedule, we are unsubscribed
return Subscriptions.empty();
}
ScheduledAction s = poolWorker.scheduleActual(action, delayTime, unit);
innerSubscription.add(s);
s.addParent(innerSubscription);
return s;
}