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 or other request-scoped values. |
| closure | func(context.Context) (interface{}, error) | The function to be executed asynchronously. It takes a context and returns an interface{} and an error. |
Returns
| Type | Description |
|---|---|
*AsyncFuture | A pointer to an AsyncFuture object which will eventually hold the result of the closure's execution. |