public interface Executor extends Executor, ListenableAsyncCloseable
Executor implementations are expected to run long running (blocking) tasks which may depend on other tasks
submitted to the same Executor instance.
In order to avoid deadlocks, it is generally a good idea to not allow task queuing in the Executor.| Modifier and Type | Method and Description |
|---|---|
default <T> Single<T> |
submit(Callable<? extends T> callable)
Creates a new
Single that creates and executes the passed Callable when subscribed to. |
default Completable |
submit(Runnable runnable)
Create a new
Completable that executes the passed Runnable on each subscribe. |
default <T> Single<T> |
submitCallable(Supplier<? extends Callable<? extends T>> callableSupplier)
|
default Completable |
submitRunnable(Supplier<Runnable> runnableSupplier)
Creates a new
Completable that creates and executes a Runnable when subscribed to. |
default Completable |
timer(Duration delay)
Creates a new
Completable that will complete after the time duration expires. |
default Completable |
timer(long delay,
TimeUnit unit)
Creates a new
Completable that will complete after the time duration expires. |
onClosecloseAsync, closeAsyncGracefullydefault Completable timer(long delay, TimeUnit unit)
Completable that will complete after the time duration expires.delay - The time duration which is allowed to elapse between subscribe and termination.unit - The units for duration.Completable that will complete after the time duration expires.default Completable timer(Duration delay)
Completable that will complete after the time duration expires.delay - The time duration which is allowed to elapse between subscribe and termination.Completable that will complete after the time duration expires.default Completable submit(Runnable runnable)
Completable that executes the passed Runnable on each subscribe.runnable - The Runnable to execute on each subscribe.Completable that executes a Runnable on each subscribe.default Completable submitRunnable(Supplier<Runnable> runnableSupplier)
Completable that creates and executes a Runnable when subscribed to.runnableSupplier - Supplier to create a new Runnable for every subscribe of the returned
Completable.Completable that creates and executes a new Runnable using
runnableSupplier for every subscribe.default <T> Single<T> submit(Callable<? extends T> callable)
Single that creates and executes the passed Callable when subscribed to.default <T> Single<T> submitCallable(Supplier<? extends Callable<? extends T>> callableSupplier)