Class IoScheduler.EventLoopWorker
- java.lang.Object
-
- io.reactivex.rxjava3.core.Scheduler.Worker
-
- io.reactivex.rxjava3.internal.schedulers.IoScheduler.EventLoopWorker
-
- All Implemented Interfaces:
Disposable
,java.lang.Runnable
- Enclosing class:
- IoScheduler
static final class IoScheduler.EventLoopWorker extends Scheduler.Worker implements java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicBoolean
once
private IoScheduler.CachedWorkerPool
pool
private CompositeDisposable
tasks
private IoScheduler.ThreadWorker
threadWorker
-
Constructor Summary
Constructors Constructor Description EventLoopWorker(IoScheduler.CachedWorkerPool pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose the resource, the operation should be idempotent.boolean
isDisposed()
Returns true if this resource has been disposed.void
run()
@NonNull Disposable
schedule(@NonNull java.lang.Runnable action, long delayTime, @NonNull java.util.concurrent.TimeUnit unit)
Schedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.-
Methods inherited from class io.reactivex.rxjava3.core.Scheduler.Worker
now, schedule, schedulePeriodically
-
-
-
-
Field Detail
-
tasks
private final CompositeDisposable tasks
-
pool
private final IoScheduler.CachedWorkerPool pool
-
threadWorker
private final IoScheduler.ThreadWorker threadWorker
-
once
final java.util.concurrent.atomic.AtomicBoolean once
-
-
Constructor Detail
-
EventLoopWorker
EventLoopWorker(IoScheduler.CachedWorkerPool pool)
-
-
Method Detail
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
schedule
@NonNull public @NonNull Disposable schedule(@NonNull @NonNull java.lang.Runnable action, long delayTime, @NonNull @NonNull java.util.concurrent.TimeUnit unit)
Description copied from class:Scheduler.Worker
Schedules an Runnable for execution at some point in the future specified by a time delay relative to the current time.Note to implementors: non-positive
delayTime
should be regarded as non-delayed schedule, i.e., as if theScheduler.Worker.schedule(Runnable)
was called.- Specified by:
schedule
in classScheduler.Worker
- Parameters:
action
- the Runnable to scheduledelayTime
- time to "wait" before executing the action; non-positive values indicate an non-delayed scheduleunit
- the time unit ofdelayTime
- Returns:
- a Disposable to be able to unsubscribe the action (cancel it if not executed)
-
-