ctx我应该在包的功能run参数中使用哪个?来自上层,还是 context.Background()?谢谢。hystrix.Dohystrix-goctx
package main
import(
"context"
"github.com/myteksi/hystrix-go/hystrix"
)
func tb(ctx context.Context)error{
return nil
}
func ta(ctx context.Context){
hystrix.Do("cbName", func()error{
// At this place, the ctx parameter of function tb,
// Should I use ctx from ta function, or context.Background()?
return tb(ctx)
}, nil)
}
func main(){
ta(context.Background())
}
摇曳的蔷薇
慕的地6264312
一只甜甜圈
随时随地看视频慕课网APP
相关分类