NewAsyncFuture
Creates a new Async future, that will call the method closure and return the results from the execution of this method
def NewAsyncFuture(
ctx: context.Context,
closure: func(context.Context) (interface{}, error)
) - > *AsyncFuture
Creates a new Async future, that will call the method closure and return the results from the execution of this method
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the asynchronous operation, allowing for cancellation and propagation of deadlines. |
| closure | func(context.Context) (interface{}, error) | The function to be executed asynchronously. It takes a context and returns a result and an error. |
Returns
| Type | Description |
|---|---|
*AsyncFuture | A new AsyncFuture object that will execute the provided closure asynchronously. |