Skip to main content

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

AttributeTypeDescription
Readerworkqueue.IndexedWorkQueueThe workqueue used for queuing download requests.
Writerworkqueue.IndexedWorkQueueThe 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

NameTypeDescription
ctxcontext.ContextThe 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

TypeDescription
[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

NameTypeDescription
ctxcontext.ContextThe 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

TypeDescription
[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

NameTypeDescription
ctxcontext.ContextThe context for starting the client, allowing for cancellation and deadlines during initialization.

Returns

TypeDescription
errorAn error if the client failed to start, otherwise nil.