摘要:
NewPoolWithFunc -> func(data interface{}) -> data.(Task) -> Task.Do 上面的这些函数都是同步的,添加到 NewPoolWithFunc中后,执行 invoke会变成异步 NewPool和NewPoolWithFunc本质是一样的,都是 阅读全文
posted @ 2023-11-21 22:44
潜行1
阅读(207)
评论(0)
推荐(0)
摘要:
草稿 errgroup就是在waitgroup基础上封装了一层。 我还是不喜欢 go的这个控制goroutine的方式。 只贴一下代码: func main() { eg, ctx := errgroup.WithContext(context.Background()) for i := 0; i 阅读全文
posted @ 2023-11-21 21:00
潜行1
阅读(43)
评论(0)
推荐(0)

浙公网安备 33010602011771号