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
| Type | Description |
|---|---|
[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
| Name | Type | Description |
|---|---|---|
| handler | 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
| Type | Description |
|---|---|
error | An error object if the future completed with an error, otherwise null. |