spice.maintenance.MaintenanceTask.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spice-core_sjs1_3 Show documentation
Show all versions of spice-core_sjs1_3 Show documentation
Core functionality leveraged and shared by most other sub-projects of Spice.
The newest version!
package spice.maintenance
import rapid.Task
import scala.concurrent.duration.FiniteDuration
trait MaintenanceTask {
def name: String = getClass.getSimpleName.replace("$", "")
def nextRun: FiniteDuration
def initialDelay: FiniteDuration = nextRun
def onFail: TaskResult = TaskResult.Continue
def apply(status: TaskStatus): Task[TaskResult]
def schedule(): MaintenanceTaskInstance = Maintenance.schedule(
name = name,
schedule = nextRun,
initialDelay = Some(initialDelay),
onFail = onFail
)(apply)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy