Interface Cron

All Superinterfaces:
RuntimeType.Api<CronConfig>, Task

public interface Cron extends RuntimeType.Api<CronConfig>, Task
Scheduling periodically executed task with specified cron expression.

 Scheduling.cron()
      .expression("0 45 9 ? * *")
      .task(inv -> System.out.println("Executed every day at 9:45"))
      .build()
 
  • Method Details

    • builder

      static CronConfig.Builder builder()
      Create a new fluent API builder to build a cron task.
      Returns:
      a builder instance
    • create

      static Cron create(Consumer<CronConfig.Builder> configConsumer)
      Create a cron task from configuration.
      Parameters:
      configConsumer - config consumer
      Returns:
      a new cron task configured from config
    • create

      static Cron create(CronConfig config)
      Create a cron task from programmatic configuration.
      Parameters:
      config - configuration
      Returns:
      a new cron task