use of io.reactivex.internal.schedulers.ExecutorScheduler.ExecutorWorker.BooleanRunnable in project RxJava by ReactiveX.
the class ExecutorScheduler method scheduleDirect.
@NonNull
@Override
public Disposable scheduleDirect(@NonNull Runnable run) {
Runnable decoratedRun = RxJavaPlugins.onSchedule(run);
try {
if (executor instanceof ExecutorService) {
Future<?> f = ((ExecutorService) executor).submit(decoratedRun);
return Disposables.fromFuture(f);
}
BooleanRunnable br = new BooleanRunnable(decoratedRun);
executor.execute(br);
return br;
} catch (RejectedExecutionException ex) {
RxJavaPlugins.onError(ex);
return EmptyDisposable.INSTANCE;
}
}
Aggregations