Record Class EngineOptions

java.lang.Object
java.lang.Record
com.iantapply.orchestra.engine.EngineOptions
Record Components:
workerCount - maximum concurrent execution workers
queueCapacity - maximum pending execution tasks
pollInterval - delay between durable-work scans
pollBatchSize - maximum executions loaded by one scan
leaseDuration - renewable execution lease lifetime
shutdownTimeout - graceful worker shutdown allowance

public record EngineOptions(int workerCount, int queueCapacity, Duration pollInterval, int pollBatchSize, Duration leaseDuration, Duration shutdownTimeout) extends Record
Tunable orchestration limits and timing values.
  • Constructor Details

    • EngineOptions

      public EngineOptions(int workerCount, int queueCapacity, Duration pollInterval, int pollBatchSize, Duration leaseDuration, Duration shutdownTimeout)
      Validates that every capacity and duration is positive.
  • Method Details

    • defaults

      public static EngineOptions defaults(int workerCount, int queueCapacity)
      Returns production defaults with the supplied worker and queue bounds.
      Parameters:
      workerCount - maximum concurrent workers
      queueCapacity - maximum pending tasks
      Returns:
      validated production defaults
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • workerCount

      public int workerCount()
      Returns the value of the workerCount record component.
      Returns:
      the value of the workerCount record component
    • queueCapacity

      public int queueCapacity()
      Returns the value of the queueCapacity record component.
      Returns:
      the value of the queueCapacity record component
    • pollInterval

      public Duration pollInterval()
      Returns the value of the pollInterval record component.
      Returns:
      the value of the pollInterval record component
    • pollBatchSize

      public int pollBatchSize()
      Returns the value of the pollBatchSize record component.
      Returns:
      the value of the pollBatchSize record component
    • leaseDuration

      public Duration leaseDuration()
      Returns the value of the leaseDuration record component.
      Returns:
      the value of the leaseDuration record component
    • shutdownTimeout

      public Duration shutdownTimeout()
      Returns the value of the shutdownTimeout record component.
      Returns:
      the value of the shutdownTimeout record component