当前位置: 首页>>代码示例>>Java>>正文


Java ScheduledAction.addParent方法代码示例

本文整理汇总了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;
}
 
开发者ID:J1aDong,项目名称:Gank-Meizi,代码行数:23,代码来源:HandlerScheduler.java

示例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;
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:24,代码来源:HandlerScheduler.java

示例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;
}
 
开发者ID:hello,项目名称:android-buruberi,代码行数:17,代码来源:Rx.java

示例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;
}
 
开发者ID:rmichela,项目名称:rxjava-bukkit,代码行数:17,代码来源:BukkitRxScheduler.java

示例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;
}
 
开发者ID:OpenSilk,项目名称:SyncthingAndroid,代码行数:13,代码来源:SingleThreadScheduler.java

示例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;
}
 
开发者ID:Matthias247,项目名称:adalightserver,代码行数:13,代码来源:SingleThreadedComputationScheduler.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:CachedThreadScheduler.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:EventLoopsScheduler.java


注:本文中的rx.internal.schedulers.ScheduledAction.addParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。