Readonly
deadlinereturns the time when work done on behalf of this context should be canceled. returns undefined when no deadline is set. Successive calls to Deadline return the same results.
Readonly
donereturns a channel that's closed when work done on behalf of this context should be canceled. Successive calls to Done return the same value.
Readonly
errIf done is not yet closed,err is undefined. If done is closed, err is a non-nil error explaining why
Readonly
isIf done is not yet closed, isClosed is false. If done is closed, isClosed is true
get() returns the value associated with this context for key or undefined if no value is associated with key. Successive calls to get() with the same key returns the same result.
get() returns the [value,true] associated with this context for key or [undefined, false] if no value is associated with key. Successive calls to get() with the same key returns the same result.
returns a copy of this with a new Done channel. The returned context's Done channel is closed when the returned copy cancel function is called or when the parent context's Done channel is closed, whichever happens first.
returns a copy of this with a new Done channel. The returned context's Done channel is closed when the returned copy cancel function is called or when the parent context's Done channel is closed, whichever happens first.
returns a copy of the this context with the deadline adjusted to be no later than d. If the this's deadline is already earlier than d, withDeadline(d) is semantically equivalent to this. The returned context's Done channel is closed when the deadline expires, when the returned cancel function is called, or when the this context's Done channel is closed, whichever happens first.
returns a copy of the this context with the deadline adjusted to be no later than d. If the this's deadline is already earlier than d, withDeadline(d) is semantically equivalent to this. The returned context's Done channel is closed when the deadline expires, when the returned cancel function is called, or when the this context's Done channel is closed, whichever happens first.
returns withDeadline(now + millisecond).
returns withDeadline(now + millisecond).
returns a copy of parent in which the value associated with key is val.
Generated using TypeDoc
A Context carries a deadline, a cancellation signal, and other values across API boundaries.