Interface TimeoutConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<Timeout>
All Known Implementing Classes:
TimeoutConfig.BuilderBase.TimeoutConfigImpl

public interface TimeoutConfig extends Prototype.Api
Timeout configuration bean.
See Also:
  • Method Details

    • builder

      static TimeoutConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static TimeoutConfig.Builder builder(TimeoutConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static TimeoutConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static TimeoutConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • name

      Optional<String> name()
      Name for debugging, error reporting, monitoring.
      Returns:
      name of this timeout
    • timeout

      Duration timeout()
      Duration to wait before timing out. Defaults to 10 seconds.
      Returns:
      timeout
    • currentThread

      boolean currentThread()
      Flag to indicate that code must be executed in current thread instead of in an executor's thread. This flag is false by default.
      Returns:
      whether to execute on current thread (true), or in an executor service (false})
    • executor

      Executor service to schedule the timeout.
      Returns:
      executor service to use