Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
659 views
in Technique[技术] by (71.8m points)

关闭goroutine问题

main入口启动一个协程a
协程a里面又启动一个协程b
如果a协程满足一个条件, 需要通知b关闭协程, 以及自身也需要关闭协程

请问下这个需求,在golang中怎么实现?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

context 就是专门用来解决这件事的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

Just Browsing Browsing

[2] html - How to create even cell spacing within a

2.1m questions

547k answers

4 comments

35.5k users

...