org.mariadb.jdbc.internal.util.scheduler

## Interface DynamicSizedSchedulerInterface

All Superinterfaces:
  Executor, ExecutorService, ScheduledExecutorService

All Known Implementing Classes:
  DynamicSizedSchedulerImpl

    public interface DynamicSizedSchedulerInterface
    extends ScheduledExecutorService

### Method Summary

All Methods Instance Methods Abstract Methods
`Future<?>` `addThreadAndExecute(Runnable task)` Used when you want to ensure an extra thread is available to execute task.
`Future<?>` `addThreadAndSchedule(Runnable task, long delay, TimeUnit unit)` Used when you want to ensure an extra thread is available for scheduled task.
`void` `adjustPoolSize(int delta)` Adjusts the pool size by a given delta.
`void` `setPoolSize(int newSize)` Update the pool thread count with this new value.

### Methods inherited from interface java.util.concurrent.ScheduledExecutorService

`schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay`

### Methods inherited from interface java.util.concurrent.ExecutorService

`awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit`

### Methods inherited from interface java.util.concurrent.Executor

`execute`

### Method Detail

#### setPoolSize

    void setPoolSize(int newSize)

Update the pool thread count with this new value.

Parameters:
  `newSize` - New pool size that is superior to 0

#### adjustPoolSize

    void adjustPoolSize(int delta)

Adjusts the pool size by a given delta. This should atomically change the pool size in a thread safe way.

Parameters:
  `delta` - A positive or negative number to adjust the pool size by.

#### addThreadAndExecute

    Future<?> addThreadAndExecute(Runnable task)

Used when you want to ensure an extra thread is available to execute task. This will adjust the pool size so that a thread can be created (if necessary), and then execute the task. Once the task completes the pool size will be adjusted back down.

Parameters:
  `task` - Task to be executed
Returns:
  Future which represents task execution

#### addThreadAndSchedule

    Future<?> addThreadAndSchedule(Runnable task,
                                   long delay,
                                   TimeUnit unit)

Used when you want to ensure an extra thread is available for scheduled task. This will adjust the pool size so that a thread can be created (if necessary), and then execute the task. Once the task completes the pool size will be adjusted back down.

Parameters:
  `task` - Task to be executed
  `delay` - delay before execution
  `unit` - unit of delay
Returns:
  Future which represents task execution