org.apache.http.impl.client.cache

## Class ImmediateSchedulingStrategy

- java.lang.Object
- - org.apache.http.impl.client.cache.ImmediateSchedulingStrategy

- All Implemented Interfaces:
    Closeable, AutoCloseable, SchedulingStrategy

      @Contract(threading=SAFE)
      public class ImmediateSchedulingStrategy
      extends Object
      implements SchedulingStrategy

  Immediately schedules any incoming validation request. Relies on `CacheConfig` to configure the used `ThreadPoolExecutor`.
  Since:
    4.3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImmediateSchedulingStrategy(CacheConfig cacheConfig)` Uses a `ThreadPoolExecutor` which is configured according to the given `CacheConfig`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `schedule(AsynchronousValidationRequest revalidationRequest)` Schedule an `AsynchronousValidationRequest` to be executed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ImmediateSchedulingStrategy

          public ImmediateSchedulingStrategy(CacheConfig cacheConfig)

      Uses a `ThreadPoolExecutor` which is configured according to the given `CacheConfig`.
      Parameters:
        `cacheConfig` - specifies thread pool settings. See `CacheConfig.getAsynchronousWorkersMax()`, `CacheConfig.getAsynchronousWorkersCore()`, `CacheConfig.getAsynchronousWorkerIdleLifetimeSecs()`, and `CacheConfig.getRevalidationQueueSize()`.

  - ### Method Detail

    - #### schedule

          public void schedule(AsynchronousValidationRequest revalidationRequest)

      Description copied from interface: `SchedulingStrategy`
      Schedule an `AsynchronousValidationRequest` to be executed.
      Specified by:
        `schedule` in interface `SchedulingStrategy`
      Parameters:
        `revalidationRequest` - the request to be executed; not `null`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.