All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spice.maintenance.TaskResult.scala Maven / Gradle / Ivy

There is a newer version: 0.7.2
Show newest version
package spice.maintenance

import scala.concurrent.duration.FiniteDuration

sealed trait TaskResult

object TaskResult {
  /**
   * Should continue on the normal schedule.
   */
  case object Continue extends TaskResult

  /**
   * Should stop and not run again.
   */
  case object Stop extends TaskResult

  /**
   * Should run again immediately.
   */
  case object RunAgain extends TaskResult

  /**
   * Configures a new scheduling delay for the next and all future schedulings.
   */
  case class ChangeSchedule(delay: () => FiniteDuration) extends TaskResult
  object ChangeSchedule {
    def to(delay: => FiniteDuration): ChangeSchedule = new ChangeSchedule(() => delay)
  }

  /**
   * Schedules the next run on a new schedule and then will return to the normal schedule.
   */
  case class NextSchedule(delay: FiniteDuration) extends TaskResult
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy