WithDeadline
WithDeadline returns a copy of the parent context which will be cancelled when the deadline arrives. Unlike context.WithDeadline the deadline will not be adjusted, and it will not return the context.DeadlineExceeded error. Canceling before the deadline will not clean up the spawned goroutine however the goroutine will become a no-op. It is possible for pauses in Wasm execution to cause the cancellation to happen after the deadline. This should not be relied on for applications where a precise deadline is required.
Canceling this context releases resources associated with it, so code should call cancel as soon as the operations running in this Context complete.
Parameters
- parent: context.Context
- d: time.Time
Returns