IndexedWorkQueue
Represents the indexed queue semantics. An indexed work queue is a work queue that additionally keeps track of the final processing results of work items.
Methods
Queue()
@classmethod
def Queue(
ctx: context.Context,
id: [WorkItemID](workitemid.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitemid),
once: [WorkItem](workitem.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitem)
) - > error
Queues the item to be processed. If the item is already in the cache or has been processed before (and is still in-memory), it'll not be added again.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation or timeouts. |
| id | [WorkItemID](workitemid.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitemid) | The unique identifier for the work item. |
| once | [WorkItem](workitem.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitem) | The work item to be queued for processing. |
Returns
| Type | Description |
|---|---|
error | An error if the item could not be queued. |
Get()
@classmethod
def Get(
id: [WorkItemID](workitemid.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitemid)
) - > (info WorkItemInfo, found bool, err error)
Retrieves an item by id.
Parameters
| Name | Type | Description |
|---|---|---|
| id | [WorkItemID](workitemid.md?sid=flyteplugins_go_tasks_pluginmachinery_workqueue_workitemid) | The unique identifier of the work item to retrieve. |
Returns
| Type | Description |
|---|---|
(info WorkItemInfo, found bool, err error) | Returns the WorkItemInfo if found, a boolean indicating if the item was found, and an error if any occurred during retrieval. |
Start()
@classmethod
def Start(
ctx: context.Context
) - > error
Start must be called before queuing items into the queue.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing cancellation or timeouts. |
Returns
| Type | Description |
|---|---|
error | An error if the queue could not be started. |