Processor
This interface represents the core logic for processing work items. Implementations of this interface define how individual WorkItem objects are handled, returning a WorkStatus and any potential errors encountered during processing.
Methods
Process()
@classmethod
def Process(
ctx: context.Context,
workItem: [WorkItem](workitem.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitem)
) - > ([WorkStatus](workstatus.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workstatus), error)
Processes a single work item using the provided context. Callers use this method to execute the core logic for a specific work unit, which may involve I/O or state changes.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used to carry deadlines, cancellation signals, and other request-scoped values across API boundaries. |
| workItem | [WorkItem](workitem.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitem) | The specific work item to be processed by the Processor. |
Returns
| Type | Description |
|---|---|
([WorkStatus](workstatus.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workstatus), error) | A tuple containing the status of the work item after processing and an error if the processing failed. |