MCPcopy Create free account
hub / github.com/bytemode/pitaya-notes / AddToPropagateCtx

Function AddToPropagateCtx

context/context.go:57–61  ·  view source on GitHub ↗

上下文 多goroutine共享数据和多goroutine管理机制 type Context interface { Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} } Deadline 会返回一个超时时间,Goroutine获得了超时时间后,例如可以对某些io操作设定超时时间。 Done方 法返回一个信道(channel),当Context被撤销或过期时,该信道是关闭的,即它是一个表示Context是否已关闭的信号

(ctx context.Context, key string, val interface{})

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

TestAddToPropagateCtxFunction · 0.70
TestGetFromPropagateCtxFunction · 0.70
TestToMapFunction · 0.70

Calls 1

ToMapFunction · 0.85

Tested by 3

TestAddToPropagateCtxFunction · 0.56
TestGetFromPropagateCtxFunction · 0.56
TestToMapFunction · 0.56