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


Java Scheduler.Worker方法代码示例

本文整理汇总了Java中io.reactivex.Scheduler.Worker方法的典型用法代码示例。如果您正苦于以下问题:Java Scheduler.Worker方法的具体用法?Java Scheduler.Worker怎么用?Java Scheduler.Worker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.reactivex.Scheduler的用法示例。


在下文中一共展示了Scheduler.Worker方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: emit

import io.reactivex.Scheduler; //导入方法依赖的package包/类
private void emit() {
    Scheduler.Worker worker = scheduler.createWorker();
    worker.schedule(() -> {
        emitLoop();
        worker.dispose();
    });
}
 
开发者ID:konmik,项目名称:rxstate,代码行数:8,代码来源:RxState.java

示例2: betweenPeriodicSchedulesReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void betweenPeriodicSchedulesReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  CountingRunnable action = new CountingRunnable();
  worker.schedulePeriodically(action, 0, 1, SECONDS);
  delegate.triggerActions();
  assertEquals(1, action.count());
  delegate.advanceTimeBy(500, MILLISECONDS);
  assertIdle(1);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:10,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例3: runningWorkReportsBusy

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void runningWorkReportsBusy() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new Runnable() {
    @Override public void run() {
      assertBusy();
    }
  });
  delegate.triggerActions();
}
 
开发者ID:square,项目名称:RxIdler,代码行数:10,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例4: unsubscribingScheduledWorkWhileRunningWorkReportsBusy

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void unsubscribingScheduledWorkWhileRunningWorkReportsBusy() {
  final Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new Runnable() {
    @Override public void run() {
      worker.dispose();
      assertBusy();
    }
  });
  delegate.triggerActions();
}
 
开发者ID:square,项目名称:RxIdler,代码行数:11,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例5: createWorker

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Override
public Scheduler.Worker createWorker() {
  return getDelegateScheduler().createWorker();
}
 
开发者ID:drmaas,项目名称:ratpack-rx2,代码行数:5,代码来源:MultiExecutorBackedScheduler.java

示例6: scheduledWorkReportsBusy

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void scheduledWorkReportsBusy() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new CountingRunnable());
  assertBusy();
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例7: scheduledWorkUnsubscribedReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void scheduledWorkUnsubscribedReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new CountingRunnable()).dispose();
  assertIdle(1);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例8: scheduleWithZeroDelayReportsBusy

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void scheduleWithZeroDelayReportsBusy() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new CountingRunnable(), 0, SECONDS);
  assertBusy();
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例9: scheduleWithNonZeroDelayReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void scheduleWithNonZeroDelayReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new CountingRunnable(), 1, SECONDS);
  assertIdle(0);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例10: schedulePeriodicallyWithZeroDelayReportsBusy

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void schedulePeriodicallyWithZeroDelayReportsBusy() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedulePeriodically(new CountingRunnable(), 0, 1, SECONDS);
  assertBusy();
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例11: schedulePeriodicallyWithNonZeroDelayReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void schedulePeriodicallyWithNonZeroDelayReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedulePeriodically(new CountingRunnable(), 1, 1, SECONDS);
  assertIdle(0);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:6,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例12: unsubscribingScheduledWorksReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void unsubscribingScheduledWorksReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.schedule(new CountingRunnable());
  worker.dispose();
  assertIdle(1);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:7,代码来源:DelegatingIdlingResourceSchedulerTest.java

示例13: scheduleWorkAfterUnsubscribedReportsIdle

import io.reactivex.Scheduler; //导入方法依赖的package包/类
@Test public void scheduleWorkAfterUnsubscribedReportsIdle() {
  Scheduler.Worker worker = scheduler.createWorker();
  worker.dispose();
  worker.schedule(new CountingRunnable());
  assertIdle(0);
}
 
开发者ID:square,项目名称:RxIdler,代码行数:7,代码来源:DelegatingIdlingResourceSchedulerTest.java


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