| Modifier and Type | Interface and Description |
|---|---|
static interface |
JobScheduler.CancelListener
Gets notified about calls to
JobScheduler.JobHandle.cancel(boolean). |
static class |
JobScheduler.Group
Represents a common group of jobs, defining how they should be scheduled.
|
static class |
JobScheduler.Groups
This is an exhaustive list of job types that run in the database.
|
static interface |
JobScheduler.JobHandle |
Lifecycle.Delegate| Modifier and Type | Method and Description |
|---|---|
Executor |
executor(JobScheduler.Group group)
Expose a group scheduler as an
Executor |
JobScheduler.JobHandle |
schedule(JobScheduler.Group group,
Runnable job)
Schedule a new job in the specified group.
|
JobScheduler.JobHandle |
schedule(JobScheduler.Group group,
Runnable runnable,
long initialDelay,
TimeUnit timeUnit)
Schedule a new job in the specified group with the given delay
|
JobScheduler.JobHandle |
schedule(JobScheduler.Group group,
Runnable job,
Map<String,String> metadata)
Schedule a new job in the specified group, passing in metadata for the scheduling strategy to use.
|
JobScheduler.JobHandle |
scheduleRecurring(JobScheduler.Group group,
Runnable runnable,
long initialDelay,
long period,
TimeUnit timeUnit)
Schedule a recurring job where the first invocation is delayed the specified time
|
JobScheduler.JobHandle |
scheduleRecurring(JobScheduler.Group group,
Runnable runnable,
long period,
TimeUnit timeUnit)
Schedule a recurring job
|
ThreadFactory |
threadFactory(JobScheduler.Group group)
Expose a group scheduler as a
ThreadFactory. |
Executor executor(JobScheduler.Group group)
ExecutorThreadFactory threadFactory(JobScheduler.Group group)
ThreadFactory.
This is a lower-level alternative than executor(Group), where you are in control of when to spin
up new threads for your jobs.
The lifecycle of the threads you get out of here are not managed by the JobScheduler, you own the lifecycle and
must start the thread before it can be used.
This mechanism is strongly preferred over manually creating threads, as it allows a central place for record
keeping of thread creation, central place for customizing the threads based on their groups, and lays a
foundation for controlling things like thread affinity and priorities in a coordinated manner in the future.JobScheduler.JobHandle schedule(JobScheduler.Group group, Runnable job)
JobScheduler.JobHandle schedule(JobScheduler.Group group, Runnable job, Map<String,String> metadata)
JobScheduler.JobHandle schedule(JobScheduler.Group group, Runnable runnable, long initialDelay, TimeUnit timeUnit)
JobScheduler.JobHandle scheduleRecurring(JobScheduler.Group group, Runnable runnable, long period, TimeUnit timeUnit)
JobScheduler.JobHandle scheduleRecurring(JobScheduler.Group group, Runnable runnable, long initialDelay, long period, TimeUnit timeUnit)
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.