public class ThrottledScheduler extends DefaultScheduler
DefaultScheduler that has a limit on the tasks that can be run at the same time.
Exceeding tasks will block the caller, until a running task is finished.
shutdownCallback, shutdownTimeoutMillis| Constructor and Description |
|---|
ThrottledScheduler(String name,
ExecutorService executor,
int parallelTasksEstimate,
ScheduledExecutorService scheduledExecutor,
org.quartz.Scheduler quartzScheduler,
ThreadType threadsType,
ByCallerThrottlingPolicy throttingPolicy,
Supplier<Long> shutdownTimeoutMillis,
Consumer<org.mule.runtime.api.scheduler.Scheduler> shutdownCallback) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
putTask(RunnableFuture<?> task,
ScheduledFuture<?> scheduledFuture) |
protected ScheduledFuture<?> |
removeTask(RunnableFuture<?> task) |
String |
toString() |
awaitTermination, checkShutdown, doShutdown, doShutdownNow, execute, getName, getThreadType, isShutdown, isTerminated, newTaskFor, newTaskFor, schedule, schedule, scheduleAtFixedRate, scheduleWithCronExpression, scheduleWithCronExpression, scheduleWithFixedDelay, setJobClass, shutdown, shutdownNow, stop, stopFinally, taskFinished, tryTerminateinvokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submitpublic ThrottledScheduler(String name, ExecutorService executor, int parallelTasksEstimate, ScheduledExecutorService scheduledExecutor, org.quartz.Scheduler quartzScheduler, ThreadType threadsType, ByCallerThrottlingPolicy throttingPolicy, Supplier<Long> shutdownTimeoutMillis, Consumer<org.mule.runtime.api.scheduler.Scheduler> shutdownCallback)
name - the name of this schedulerexecutor - the actual executor that will run the dispatched tasks.parallelTasksEstimate - an estimate of how many threads will be, at maximum, in the underlying executorscheduledExecutor - the executor that will handle the delayed/periodic tasks. This will not execute the actual tasks,
but will dispatch it to the executor at the appropriate time.quartzScheduler - the quartz object that will handle tasks scheduled with cron expressions. This will not execute the
actual tasks, but will dispatch it to the executor at the appropriate time.threadsType - The ThreadType that matches with the Threads managed by this Scheduler.throttingPolicy - the action to perform when too many tasks are running at the same time for this Scheduler.shutdownTimeoutMillis - the time in millis to wait for the graceful stop of this schedulershutdownCallback - a callback to be invoked when this scheduler is stopped/shutdown.protected void putTask(RunnableFuture<?> task, ScheduledFuture<?> scheduledFuture)
putTask in class DefaultSchedulerprotected ScheduledFuture<?> removeTask(RunnableFuture<?> task)
removeTask in class DefaultSchedulerpublic String toString()
toString in class DefaultSchedulerCopyright © 2003–2018 MuleSoft, Inc.. All rights reserved.