MCPcopy Create free account
hub / github.com/Monibuca/engine / NewPromise

Function NewPromise

util/safe_chan.go:89–98  ·  view source on GitHub ↗
(value S)

Source from the content-addressed store, hash-verified

87}
88
89func NewPromise[S any](value S) *Promise[S] {
90 ctx0, cancel0 := context.WithTimeout(context.Background(), time.Second*10)
91 ctx, cancel := context.WithCancelCause(ctx0)
92 return &Promise[S]{
93 Value: value,
94 Context: ctx,
95 CancelCauseFunc: cancel,
96 CancelFunc: cancel0,
97 }
98}

Callers 2

receiveMethod · 0.92
AddTrackMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected