public final class IoScheduler extends Scheduler
Scheduler.Worker
Constructor and Description |
---|
IoScheduler() |
IoScheduler(ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
Scheduler.Worker |
createWorker()
Retrieves or creates a new
Scheduler.Worker that represents sequential execution of actions. |
void |
shutdown()
Instructs the Scheduler instance to stop threads,
stop accepting tasks on any outstanding
Scheduler.Worker instances
and clean up any associated resources with this Scheduler. |
int |
size() |
void |
start()
Allows the Scheduler instance to start threads
and accept tasks on them.
|
clockDriftTolerance, now, scheduleDirect, scheduleDirect, schedulePeriodicallyDirect, when
public IoScheduler()
public IoScheduler(ThreadFactory threadFactory)
threadFactory
- thread factory to use for creating worker threads. Note that this takes precedence over any
system properties for configuring new thread creation. Cannot be null.public void start()
Scheduler
Implementations should make sure the call is idempotent, thread-safe and
should not throw any RuntimeException
if it doesn't support this
functionality.
public void shutdown()
Scheduler
Scheduler.Worker
instances
and clean up any associated resources with this Scheduler.
Implementations should make sure the call is idempotent, thread-safe and
should not throw any RuntimeException
if it doesn't support this
functionality.
@NonNull public Scheduler.Worker createWorker()
Scheduler
Scheduler.Worker
that represents sequential execution of actions.
When work is completed, the Worker
instance should be released
by calling Disposable.dispose()
to avoid potential resource leaks in the
underlying task-execution scheme.
Work on a Scheduler.Worker
is guaranteed to be sequential and non-overlapping.
createWorker
in class Scheduler
public int size()
Copyright © 2018 JBoss by Red Hat. All rights reserved.