Kronos

object Kronos

Properties

Link copied to clipboard
var lastPingTime: <Error class: unknown class>?
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun allJobs(): List<KronoJob>

Returns all scheduled Jobs

suspend fun allJobs(name: String): List<KronoJob>

Returns all scheduled Jobs with jobName

Link copied to clipboard
suspend fun checkJob(jobId: String): String?

Get The data about a job,

Link copied to clipboard
suspend fun dropAll(): Boolean
Link copied to clipboard
suspend fun dropJob(name: String): Boolean

Cancel and remove all scheduled jobs with the given name. Triggers Job.onDrop for each. Returns true if the delete was acknowledged.

Link copied to clipboard
suspend fun dropJobId(id: String): Boolean

Cancel and remove a single job by its ID. Triggers Job.onDrop. Returns true if the job was found and deleted.

Link copied to clipboard
suspend fun Kronos.handleJob(kronoJob: KronoJob, currentInstant: <Error class: unknown class> = Clock.System.now())
Link copied to clipboard
fun init(store: KronosStore, dispatcher: <Error class: unknown class> = Dispatchers.IO): Kronos

Initialize Kronos with a backend store. Call once at application startup.

Link copied to clipboard
fun register(job: Job)

Register a Job implementation. Must be called before scheduling jobs with this name. Registration is in-memory — call this on every application startup.

Link copied to clipboard
suspend fun Kronos.schedule(jobName: String, delay: <Error class: unknown class> = Duration.ZERO, interval: <Error class: unknown class>? = null, endTime: Long? = null, maxCycles: Int? = null, retries: Int? = null, params: Map<String, String>, overshotAction: OvershotAction = OvershotAction.Drop): String?
suspend fun Kronos.schedule(jobName: String, startTime: Long, interval: <Error class: unknown class>? = null, endTime: Long? = null, maxCycles: Int? = null, retries: Int? = null, params: Map<String, String>, overshotAction: OvershotAction = OvershotAction.Drop): String?
Link copied to clipboard
suspend fun Kronos.schedulePeriodic(jobName: String, delay: <Error class: unknown class> = Duration.ZERO, periodic: Periodic, endTime: Long? = null, maxCycles: Int? = null, retries: Int? = null, params: Map<String, String>, overshotAction: OvershotAction = OvershotAction.Drop): String?
suspend fun Kronos.schedulePeriodic(jobName: String, startTime: Long, periodic: Periodic, endTime: Long? = null, maxCycles: Int? = null, retries: Int? = null, params: Map<String, String>, overshotAction: OvershotAction = OvershotAction.Drop): String?