public interface SchedulerService
extends org.mule.runtime.api.service.Service
This interface provides access to different schedulers, each with its own configured tuning options, optimized for some specific kind of work. Artifacts that need to dispatch tasks need to carefully determine which scheduler best fits the nature of the task in order to keep the resources usage and the impact on other artifacts at a minimum.
The Schedulers returned by methods in the implementations must provide access the the thread pools in the Mule Runtime
that have the expected tuning configuration. Each Scheduler will have its own lifecycle, managed by its user and NOT
this service.
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.api.scheduler.Scheduler |
cpuIntensiveScheduler()
Builds a fresh
Scheduler with a default configuration for heavy computation or CPU intensive tasks. |
org.mule.runtime.api.scheduler.Scheduler |
cpuIntensiveScheduler(SchedulerConfig config)
Builds a fresh
Scheduler for heavy computation or CPU intensive tasks. |
org.mule.runtime.api.scheduler.Scheduler |
cpuIntensiveScheduler(SchedulerConfig config,
SchedulerPoolsConfigFactory poolsConfigFactory)
Builds a fresh
Scheduler for heavy computation or CPU intensive tasks. |
org.mule.runtime.api.scheduler.Scheduler |
cpuLightScheduler()
Builds a fresh
Scheduler with a default configuration for light CPU tasks. |
org.mule.runtime.api.scheduler.Scheduler |
cpuLightScheduler(SchedulerConfig config)
Builds a fresh
Scheduler for light CPU tasks. |
org.mule.runtime.api.scheduler.Scheduler |
cpuLightScheduler(SchedulerConfig config,
SchedulerPoolsConfigFactory poolsConfigFactory)
Builds a fresh
Scheduler for light CPU tasks. |
org.mule.runtime.api.scheduler.Scheduler |
customScheduler(SchedulerConfig config)
Builds a fresh
Scheduler for custom tasks. |
org.mule.runtime.api.scheduler.Scheduler |
customScheduler(SchedulerConfig config,
int queueSize)
Builds a fresh
Scheduler for custom tasks. |
List<org.mule.runtime.api.scheduler.Scheduler> |
getSchedulers()
Provides a read-only view of all currently active
Schedulers created through this service. |
org.mule.runtime.api.scheduler.Scheduler |
ioScheduler()
Builds a fresh
Scheduler with a default configuration for blocking I/O tasks. |
org.mule.runtime.api.scheduler.Scheduler |
ioScheduler(SchedulerConfig config)
Builds a fresh
Scheduler for blocking I/O tasks. |
org.mule.runtime.api.scheduler.Scheduler |
ioScheduler(SchedulerConfig config,
SchedulerPoolsConfigFactory poolsConfigFactory)
Builds a fresh
Scheduler for blocking I/O tasks. |
org.mule.runtime.api.scheduler.Scheduler cpuLightScheduler()
Scheduler with a default configuration for light CPU tasks. The returned Scheduler is backed
by the Mule runtime cpu-light executor, which is shared by all Schedulers returned by this method.
A task is considered cpu-light if it doesn't block at any time and its duration is less than 10 milliseconds.
Implementations must get the appropriate config from the runtime context to build the target Scheduler. This method
must act only as a delegate of cpuLightScheduler(SchedulerConfig, SchedulerPoolsConfigFactory).
cpu-light tasks.org.mule.runtime.api.scheduler.Scheduler ioScheduler()
Scheduler with a default configuration for blocking I/O tasks. The returned Scheduler is
backed by the Mule runtime blocking I/O executor, which is shared by all Schedulers returned by this method.
A task is considered blocking I/O if it spends most of it's clock duration blocked due to I/O operations.
Implementations must get the appropriate config from the runtime context to build the target Scheduler. This method
must act only as a delegate of ioScheduler(SchedulerConfig, SchedulerPoolsConfigFactory).
blocking I/O tasks.org.mule.runtime.api.scheduler.Scheduler cpuIntensiveScheduler()
Scheduler with a default configuration for heavy computation or CPU intensive tasks. The returned
Scheduler is backed by the Mule runtime computation executor, which is shared by all Schedulers returned by
this method.
A task is considered a CPU intensive if its duration is more than 10 milliseconds and less than 20% of its clock time
is due to blocking.
Implementations must get the appropriate config from the runtime context to build the target Scheduler. This method
must act only as a delegate of cpuIntensiveScheduler(SchedulerConfig, SchedulerPoolsConfigFactory).
CPU intensive tasks.org.mule.runtime.api.scheduler.Scheduler cpuLightScheduler(SchedulerConfig config)
Scheduler for light CPU tasks. The returned Scheduler is backed by the Mule runtime cpu-light
executor, which is shared by all Schedulers returned by this method.
A task is considered cpu-light if it doesn't block at any time and its duration is less than 10 milliseconds.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.cpu-light tasks.org.mule.runtime.api.scheduler.Scheduler ioScheduler(SchedulerConfig config)
Scheduler for blocking I/O tasks. The returned Scheduler is backed by the Mule runtime
blocking I/O executor, which is shared by all Schedulers returned by this method.
A task is considered blocking I/O if it spends most of it's clock duration blocked due to I/O operations.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.blocking I/O tasks.org.mule.runtime.api.scheduler.Scheduler cpuIntensiveScheduler(SchedulerConfig config)
Scheduler for heavy computation or CPU intensive tasks. The returned Scheduler is backed by
the Mule runtime computation executor, which is shared by all Schedulers returned by this method.
A task is considered a CPU intensive if its duration is more than 10 milliseconds and less than 20% of its clock time
is due to blocking.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.CPU intensive tasks.org.mule.runtime.api.scheduler.Scheduler cpuLightScheduler(SchedulerConfig config, SchedulerPoolsConfigFactory poolsConfigFactory)
Scheduler for light CPU tasks. The returned Scheduler is backed by the Mule runtime cpu-light
executor, which is shared by all Schedulers returned by this method.
A task is considered cpu-light if it doesn't block at any time and its duration is less than 10 milliseconds.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.poolsConfigFactory - the configuration to use for the thread pools that the schedulers use.cpu-light tasks.org.mule.runtime.api.scheduler.Scheduler ioScheduler(SchedulerConfig config, SchedulerPoolsConfigFactory poolsConfigFactory)
Scheduler for blocking I/O tasks. The returned Scheduler is backed by the Mule runtime
blocking I/O executor, which is shared by all Schedulers returned by this method.
A task is considered blocking I/O if it spends most of it's clock duration blocked due to I/O operations.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.poolsConfigFactory - the configuration to use for the thread pools that the schedulers use.blocking I/O tasks.org.mule.runtime.api.scheduler.Scheduler cpuIntensiveScheduler(SchedulerConfig config, SchedulerPoolsConfigFactory poolsConfigFactory)
Scheduler for heavy computation or CPU intensive tasks. The returned Scheduler is backed by
the Mule runtime computation executor, which is shared by all Schedulers returned by this method.
A task is considered a CPU intensive if its duration is more than 10 milliseconds and less than 20% of its clock time
is due to blocking.
If the provided config has maxConcurrentTasks set, exceeding tasks will block the caller, until a running
task is finished.
config - allows customization of the returned scheduler.poolsConfigFactory - the configuration to use for the thread pools that the schedulers use.CPU intensive tasks.org.mule.runtime.api.scheduler.Scheduler customScheduler(SchedulerConfig config)
Scheduler for custom tasks. The returned Scheduler is backed by an
ExecutorService built with the given corePoolSize threads and a
SynchronousQueue.config - allows customization of the returned scheduler.custom tasks.org.mule.runtime.api.scheduler.Scheduler customScheduler(SchedulerConfig config, int queueSize)
Scheduler for custom tasks. The returned Scheduler is backed by an
ExecutorService built with the given corePoolSize threads and a
LinkedBlockingQueue with the given queueSize.config - allows customization of the returned scheduler.custom tasks.List<org.mule.runtime.api.scheduler.Scheduler> getSchedulers()
Schedulers created through this service.Schedulers.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.