Class DurableJobsRuntime
java.lang.Object
com.kingsrook.qqq.backend.core.jobs.runtime.DurableJobsRuntime
The per-pod durable jobs runtime: worker threads that claim and run chunks,
a heartbeat per running chunk (every ttl/3), the lease reaper (every pod,
every reaperIntervalSeconds), stall detection, and graceful drain.
Chunks run on this runtime's own bounded pool (workerThreads), never on
AsyncJobManager's pool. workerThreads = 0 makes an API-only pod: it still
reaps, but claims nothing.
DurableJobsRuntime.start(qInstance); // at server start DurableJobsRuntime.stop(qInstance, Duration.ofSeconds(30)); // on SIGTERM
-
Method Summary
Modifier and TypeMethodDescriptionstatic DurableJobsRuntimeThe running runtime for an instance, or null.Tracker for this pod.getPodId()Getter for podIdgetStore()Getter for storestatic voidTest seam: a hook called around each effect delivery (fault injection).static DurableJobsRuntimeStart the runtime for an instance (no-op if durable jobs are off or it is already running).static voidStop an instance's runtime: stop claiming, let running chunks reach a safe point and release their leases (no attempt counted), wait up to the given time, then stop.
-
Method Details
-
start
Start the runtime for an instance (no-op if durable jobs are off or it is already running). Returns the runtime, or null when off. -
stop
Stop an instance's runtime: stop claiming, let running chunks reach a safe point and release their leases (no attempt counted), wait up to the given time, then stop. Chunks still running after that are reclaimed by another pod when their lease expires. -
get
The running runtime for an instance, or null. -
setEffectFaultHook
Test seam: a hook called around each effect delivery (fault injection). Set before start; production never sets it. -
getPodId
Getter for podId -
getStore
Getter for store -
getInlineJobTracker
Tracker for this pod.
-