Skip to content

//misk-jobqueue/misk.jobqueue

Package-level declarations

Types

Name Summary
Job [jvm]
interface Job
Incoming job
JobConsumer [jvm]
interface JobConsumer
A JobConsumer allows applications to subscribe to receive incoming jobs
JobHandler [jvm]
interface JobHandler
A JobHandler is an application implemented interface that handles jobs received by this service. JobHandlers must explicitly call Job.acknowledge after successful processing to cause the to be deleted from the underlying queue and not redelivered, or can call Job.deadLetter to put the job onto the associated dead letter queue. The jobqueue framework assumes that the underlying queueing system is at-least-once, so handlers must be prepared for the possibility that a job will be delivered more than once (for example if the process fails or the visibility timeout expires after processing but before acknowledgement). Typically this is handled by either storing some sort of ticket in the local database when the job is enqueued and deleting it as part of the application transaction when the job is processed but prior to acknowledgement, or by storing some sort of "processed marker" in the local database during job processing and ignoring jobs whose marker is already recorded.
JobQueue [jvm]
interface JobQueue
A JobQueue enqueues jobs for asynchronous execution, possibly in another process. Jobs are enqueued immediately and may involve an RPC to the underlying job queueing system, so should not be done from within a database transaction. Applications that need to enqueue jobs atomically with a local database transaction should use the TransactionalJobQueue interface
QueueName [jvm]
data class QueueName(val value: String)

Functions

Name Summary
subscribe [jvm]
inline fun JobConsumer.subscribe(queueName: QueueName, crossinline handler: (Job) -> Unit)