DesktopJabbit

The desktop Jabbit, which owns the resources it needs and can hand them back.

Closing it stops the scheduler and releases the single instance lock. A running job is cancelled cooperatively and returns to JobState.ENQUEUED, so it starts again next time the application runs.

Functions

Link copied to clipboard
abstract suspend fun cancelAllJobs()

Cancels every unfinished job known to this instance.

Link copied to clipboard
abstract suspend fun cancelJob(id: JobId)

Cancels the job with id.

Link copied to clipboard
abstract suspend fun cancelJobsByTag(tag: String)

Cancels every unfinished job carrying tag.

Link copied to clipboard
abstract suspend fun cancelUniqueJob(uniqueName: String)

Cancels the unfinished job enqueued under uniqueName.

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun enqueue(requests: List<JobRequest>)

Enqueues requests as one batch.

abstract suspend fun enqueue(request: JobRequest)

Enqueues request.

Link copied to clipboard
abstract suspend fun enqueueUnique(uniqueName: String, policy: ExistingJobPolicy, request: OneTimeJobRequest)

Enqueues request as the only job carrying uniqueName, resolving a collision with an unfinished job of the same name through policy.

Link copied to clipboard
abstract suspend fun enqueueUniquePeriodic(uniqueName: String, policy: ExistingPeriodicJobPolicy, request: PeriodicJobRequest)

Enqueues request as the only periodic job carrying uniqueName, resolving a collision with an unfinished job of the same name through policy.

Link copied to clipboard
abstract suspend fun getJobInfo(id: JobId): JobInfo?

Returns the current state of the job with id, or null when it is unknown or pruned.

Link copied to clipboard
abstract fun getJobInfoFlow(id: JobId): Flow<JobInfo?>

Emits the state of the job with id and every later change to it, or null while the job is unknown.

Link copied to clipboard
abstract suspend fun getJobInfosByTag(tag: String): List<JobInfo>

Returns the current state of every known job carrying tag.

Link copied to clipboard
abstract fun getJobInfosByTagFlow(tag: String): Flow<List<JobInfo>>

Emits the state of every known job carrying tag and every later change to it.

Link copied to clipboard
abstract suspend fun getJobInfosForUniqueJob(uniqueName: String): List<JobInfo>

Returns the current state of every known job enqueued under uniqueName.

Link copied to clipboard
abstract fun getJobInfosForUniqueJobFlow(uniqueName: String): Flow<List<JobInfo>>

Emits the state of every known job enqueued under uniqueName and every later change.

Link copied to clipboard
abstract suspend fun pruneFinishedJobs()

Drops the records of finished jobs, releasing the storage they occupy.