io.reactivex.Scheduler.start()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中io.reactivex.Scheduler.start()方法的一些代码示例,展示了Scheduler.start()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.start()方法的具体详情如下:
包路径:io.reactivex.Scheduler
类名称:Scheduler
方法名:start

Scheduler.start介绍

[英]Allows the Scheduler instance to start threads and accept tasks on them.

Implementations should make sure the call is idempotent, thread-safe and should not throw any RuntimeException if it doesn't support this functionality.
[中]允许调度程序实例启动线程并接受线程上的任务。
实现应该确保调用是幂等的、线程安全的,如果不支持此功能,则不应该抛出任何RuntimeException。

代码示例

代码示例来源:origin: ReactiveX/RxJava

@Override
  public void run() {
    s.start();
  }
};

代码示例来源:origin: ReactiveX/RxJava

/**
 * Starts the standard Schedulers.
 * <p>The operation is idempotent and thread-safe.
 */
public static void start() {
  computation().start();
  io().start();
  newThread().start();
  single().start();
  trampoline().start();
  SchedulerPoolFactory.start();
}

代码示例来源:origin: redisson/redisson

/**
 * Starts the standard Schedulers.
 * <p>The operation is idempotent and thread-safe.
 */
public static void start() {
  computation().start();
  io().start();
  newThread().start();
  single().start();
  trampoline().start();
  SchedulerPoolFactory.start();
}

代码示例来源:origin: akarnokd/RxJava2Interop

@Override
public void start() {
  source.start();
}

代码示例来源:origin: akarnokd/RxJava2Interop

@Test
public void startStopNotSupported() {
  rx.Scheduler v1Scheduler = mock(rx.Scheduler.class);
  io.reactivex.Scheduler v2Scheduler = RxJavaInterop.toV2Scheduler(v1Scheduler);
  v2Scheduler.start();
  verifyNoMoreInteractions(v1Scheduler);
  v2Scheduler.shutdown();
  verifyNoMoreInteractions(v1Scheduler);
}

代码示例来源:origin: akarnokd/RxJava2Interop

@Test
  public void startStopSupport() {
    Scheduler v2Scheduler = mock(Scheduler.class);
    rx.Scheduler v1Scheduler = RxJavaInterop.toV1Scheduler(v2Scheduler);

    SchedulerLifecycle lc = (SchedulerLifecycle)v1Scheduler;

    lc.start();

    verify(v2Scheduler).start();

    lc.shutdown();

    verify(v2Scheduler).shutdown();
  }
}

代码示例来源:origin: akarnokd/RxJava2Interop

@Test
  public void startStopSupported() {
    rx.Scheduler v1Scheduler = mock(rx.Scheduler.class, withSettings().extraInterfaces(SchedulerLifecycle.class));
    io.reactivex.Scheduler v2Scheduler = RxJavaInterop.toV2Scheduler(v1Scheduler);

    v2Scheduler.start();

    ((SchedulerLifecycle)verify(v1Scheduler)).start();

    v2Scheduler.shutdown();

    ((SchedulerLifecycle)verify(v1Scheduler)).shutdown();
  }
}

代码示例来源:origin: com.github.akarnokd/rxjava2-interop

@Override
public void start() {
  source.start();
}

代码示例来源:origin: akarnokd/RxJava2Extensions

@Override
  public void run() {
    s.start();
  }
};

代码示例来源:origin: akarnokd/RxJava2Extensions

private void startStop(Scheduler s) {
  s.start();
  s.shutdown();
  s.shutdown();
}

代码示例来源:origin: akarnokd/RxJava2Extensions

s.start();

相关文章