AsyncClientImpl
This class represents an asynchronous client for catalog operations. It is designed to queue download and upload requests using dedicated workqueues for reading and writing.
Attributes
| Attribute | Type | Description |
|---|---|---|
| Reader | workqueue.IndexedWorkQueue | The workqueue used for queuing download requests. |
| Writer | workqueue.IndexedWorkQueue | The workqueue used for queuing upload requests. |
Methods
Download()
@classmethod
def Download(
ctx: context.Context,
requests: [DownloadRequest](downloadrequest.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_downloadrequest)
) - > [DownloadFuture](downloadfuture.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_downloadfuture)
Queues a download request on the workqueue. Callers use this to initiate asynchronous file downloads.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the download operation, allowing for cancellation and deadlines. |
| requests | [DownloadRequest](downloadrequest.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_downloadrequest) | The specific details of the file to be downloaded, including source and destination. |
Returns
| Type | Description |
|---|---|
[DownloadFuture](downloadfuture.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_downloadfuture) | A future that will eventually hold the result of the download operation, or an error if the request could not be queued. |
Upload()
@classmethod
def Upload(
ctx: context.Context,
requests: [UploadRequest](uploadrequest.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_uploadrequest)
) - > [UploadFuture](uploadfuture.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_uploadfuture)
Queues an upload request on the workqueue. Callers use this to initiate asynchronous file uploads.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the upload operation, allowing for cancellation and deadlines. |
| requests | [UploadRequest](uploadrequest.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_uploadrequest) | The specific details of the file to be uploaded, including source and destination. |
Returns
| Type | Description |
|---|---|
[UploadFuture](uploadfuture.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_uploadfuture) | A future that will eventually hold the result of the upload operation, or an error if the request could not be queued. |
Start()
@classmethod
def Start(
ctx: context.Context
) - > error
Starts the asynchronous client, initializing its internal workqueues. Callers must invoke this method before queuing any download or upload requests.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for starting the client, allowing for cancellation and deadlines during initialization. |
Returns
| Type | Description |
|---|---|
error | An error if the client failed to start, otherwise nil. |