Enum Class ScheduleMode

java.lang.Object
java.lang.Enum<ScheduleMode>
io.agentscope.extensions.scheduler.config.ScheduleMode
All Implemented Interfaces:
Serializable, Comparable<ScheduleMode>, Constable

public enum ScheduleMode extends Enum<ScheduleMode>
Enumeration of scheduling modes supported by the scheduler.

This enum defines the different timing strategies that can be used to schedule agent execution.

See Also:
  • Enum Constant Details

    • NONE

      public static final ScheduleMode NONE
      No scheduling - the agent will not be automatically scheduled.

      This is the default mode. When set to NONE, the agent will not be executed automatically by the scheduler. The agent can still be called manually through its normal call methods.

      Use case: Agents that should only be executed on-demand or manually triggered.

    • CRON

      public static final ScheduleMode CRON
      Cron-based scheduling using cron expressions.

      Allows flexible scheduling based on cron syntax, supporting complex patterns like "execute every Monday at 9 AM" or "execute on the first day of each month".

      Example expressions:

      • "0 0 8 * * ?" - Every day at 8:00 AM
      • "0 0/30 * * * ?" - Every 30 minutes
      • "0 0 9 * * MON-FRI" - Every weekday at 9:00 AM
      • "0 0 0 1 * ?" - First day of every month at midnight
    • FIXED_RATE

      public static final ScheduleMode FIXED_RATE
      Fixed-rate scheduling with constant intervals between execution starts.

      The task executes at fixed intervals regardless of execution duration. If an execution takes longer than the interval, the next execution may start immediately after the previous one completes (depending on concurrency policy).

      Use case: Regular polling, periodic health checks, time-based triggers.

      Example: With a 5-minute rate, executions start at T, T+5min, T+10min, etc.

    • FIXED_DELAY

      public static final ScheduleMode FIXED_DELAY
      Fixed-delay scheduling with constant delays between execution completion and next start.

      The task waits for a fixed duration after completion before starting the next execution. This ensures a minimum idle time between executions.

      Use case: Sequential processing, rate-limited operations, preventing system overload.

      Example: With a 5-minute delay, if execution takes 2 minutes, the next execution starts 7 minutes after the previous one started (2min execution + 5min delay).

  • Method Details

    • values

      public static ScheduleMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ScheduleMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null