Skip to main content

NewSyncFuture

Creates a new "completed" future that matches the async computation api

def NewSyncFuture(
val: interface{},
err: error
) - > *SyncFuture

Creates a new "completed" future that matches the async computation API.

Parameters

NameTypeDescription
valinterface{}The value to be stored in the completed future. This represents the successful result of an asynchronous operation.
errerrorThe error to be stored in the completed future. This represents an error encountered during an asynchronous operation.

Returns

TypeDescription
*SyncFutureA new SyncFuture object initialized with the provided value and error.