Skip to main content

Future

This interface represents the result of an asynchronous operation. It provides methods to check the response status, retrieve any errors, and register a callback to be notified when the operation is complete.

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
)

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

Parameters

NameTypeDescription
handlerReadyHandlerThe 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 future completed with an error, otherwise null.