Skip to main content

Future

This interface defines a generic Future, representing the result of asynchronous operations. It allows checking the response status, retrieving any associated error, and registering a callback to be notified when the future's status changes to ready.

Methods


GetResponseStatus()

@classmethod
def GetResponseStatus() - > [ResponseStatus](responsestatus.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_responsestatus)

Gets the response status for the future. If the future represents multiple operations, the status will only be ready if all of them are.

Returns

TypeDescription
[ResponseStatus](responsestatus.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_responsestatus)The current status of the asynchronous operation(s).

OnReady()

@classmethod
def OnReady(
handler: [ReadyHandler](readyhandler.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_readyhandler)
)

Sets a callback handler to be called when the future status changes to ready.

Parameters

NameTypeDescription
handler[ReadyHandler](readyhandler.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_readyhandler)The callback function to execute when the future's status becomes ready.

GetResponseError()

@classmethod
def GetResponseError() - > error

Retrieves any error that occurred during the asynchronous operation. Callers use this to determine if the operation failed and to get details about the failure.

Returns

TypeDescription
errorAn error object if the operation failed, otherwise null.