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 Details

    • submitTask

      TaskHandle submitTask(String payload)
      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

      WorkloadTaskProgress progress(TaskHandle handle)
      Reads task progress.
      Parameters:
      handle - task handle
      Returns:
      immutable progress snapshot
    • checkpoint

      Checkpoint checkpoint(TaskHandle handle)
      Creates and returns a task checkpoint.
      Parameters:
      handle - task handle
      Returns:
      checkpoint metadata
    • cancel

      boolean cancel(TaskHandle handle)
      Cancels a task.
      Parameters:
      handle - task handle
      Returns:
      whether cancellation changed the task state
    • acquireLease

      LeaseResult acquireLease(TaskHandle handle, String ownerId)
      Acquires or renews an example lease.
      Parameters:
      handle - task handle
      ownerId - owner identity
      Returns:
      lease result
    • completeWithFence

      boolean completeWithFence(TaskHandle handle, long fencingToken)
      Completes the task when the supplied fencing token is current.
      Parameters:
      handle - task handle
      fencingToken - caller fencing token
      Returns:
      whether the token was current and completion succeeded
    • adminStatus

      String adminStatus()
      Returns a compact status line for demo/admin output.
      Returns:
      safe status line