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(java.util.concurrent.Callable<? extends T> callable)
Creates a new
Single that creates and executes the passed Callable when subscribed to. |
default Completable |
submit(java.lang.Runnable runnable)
Create a new
Completable that executes the passed Runnable on each subscribe. |
default <T> Single<T> |
submitCallable(java.util.function.Supplier<? extends java.util.concurrent.Callable<? extends T>> callableSupplier)
|
default Completable |
submitRunnable(java.util.function.Supplier<java.lang.Runnable> runnableSupplier)
Creates a new
Completable that creates and executes a Runnable when subscribed to. |
default Completable |
timer(java.time.Duration delay)
Creates a new
Completable that will complete after the time duration expires. |
default Completable |
timer(long delay,
java.util.concurrent.TimeUnit unit)
Creates a new
Completable that will complete after the time duration expires. |
onClose
closeAsync, closeAsyncGracefully
default Completable timer(long delay, java.util.concurrent.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(java.time.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(java.lang.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(java.util.function.Supplier<java.lang.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(java.util.concurrent.Callable<? extends T> callable)
Single
that creates and executes the passed Callable
when subscribed to.default <T> Single<T> submitCallable(java.util.function.Supplier<? extends java.util.concurrent.Callable<? extends T>> callableSupplier)