Interface WorkloadProcessingService
- All Known Implementing Classes:
WorkloadProcessingServiceImpl
public interface WorkloadProcessingService
Minimal workload-processing example service.
The service demonstrates task submission, lifecycle state, progress, cancellation, checkpoints, leases, fencing tokens, and status visibility using bounded in-memory state. It is deliberately not a durable queue or distributed compute platform.
-
Method Summary
Modifier and TypeMethodDescriptionacquireLease(TaskHandle handle, String ownerId) Acquires or renews an example lease.Returns a compact status line for demo/admin output.booleancancel(TaskHandle handle) Cancels a task.checkpoint(TaskHandle handle) Creates and returns a task checkpoint.booleancompleteWithFence(TaskHandle handle, long fencingToken) Completes the task when the supplied fencing token is current.progress(TaskHandle handle) Reads task progress.status(TaskHandle handle) Reads task status.submitTask(String payload) Submits one in-memory task.
-
Method Details
-
submitTask
Submits one in-memory task.- Parameters:
payload- task payload- Returns:
- task handle
-
status
Reads task status.- Parameters:
handle- task handle- Returns:
- immutable status snapshot
-
progress
Reads task progress.- Parameters:
handle- task handle- Returns:
- immutable progress snapshot
-
checkpoint
Creates and returns a task checkpoint.- Parameters:
handle- task handle- Returns:
- checkpoint metadata
-
cancel
Cancels a task.- Parameters:
handle- task handle- Returns:
- whether cancellation changed the task state
-
acquireLease
Acquires or renews an example lease.- Parameters:
handle- task handleownerId- owner identity- Returns:
- lease result
-
completeWithFence
Completes the task when the supplied fencing token is current.- Parameters:
handle- task handlefencingToken- caller fencing token- Returns:
- whether the token was current and completion succeeded
-
adminStatus
-