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_3 Show documentation
Show all versions of spice-core_3 Show documentation
Core functionality leveraged and shared by most other sub-projects of YouI.
package spice.maintenance
import cats.effect.IO
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): IO[TaskResult]
def schedule(): MaintenanceTaskInstance = Maintenance.schedule(
name = name,
schedule = nextRun,
initialDelay = Some(initialDelay),
onFail = onFail
)(apply)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy