Interface TaskCallback


public interface TaskCallback
A callback interface used to announce the arrival of a new task for a worker to process or signal that the core should cancel its tasks. Generally called from a WorkerQueue implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Signal that any tasks queued or in operation should be aborted.
    void
    registerNewTask(TaskInformation taskInformation, byte[] taskData, Map<String,Object> headers)
    Announce to the worker core that a new task has been picked off the queue for processing.
  • Method Details

    • registerNewTask

      void registerNewTask(TaskInformation taskInformation, byte[] taskData, Map<String,Object> headers) throws TaskRejectedException, InvalidTaskException
      Announce to the worker core that a new task has been picked off the queue for processing.
      Parameters:
      taskInformation - contains an arbitrary task reference
      taskData - the task data that is specific to the workers hosted
      headers - the map of key/value paired headers on the message
      Throws:
      TaskRejectedException - if the worker framework rejected execution of the task at this time
      InvalidTaskException - if the worker framework indicates this task is invalid and cannot possibly be executed
    • abortTasks

      void abortTasks()
      Signal that any tasks queued or in operation should be aborted. This usually means there was a problem with the queue and any accepted messages should be considered void.