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 operation.
errerrorThe error to be stored in the completed future. If not nil, this indicates that the operation completed with an error.

Returns

TypeDescription
*SyncFutureA new SyncFuture object representing a completed operation.