1.select{
case: 阻塞事件
}
func TimeoutService() {
select {
case ret := <-AsyncService():
fmt.Println(ret)
case <-time.After(time.Millisecond * 90):
fmt.Println("timeout..")
}
}
1.select{
case: 阻塞事件
}
func TimeoutService() {
select {
case ret := <-AsyncService():
fmt.Println(ret)
case <-time.After(time.Millisecond * 90):
fmt.Println("timeout..")
}
}
本文标题:多路选择和超时机制
本文链接:https://www.haomeiwen.com/subject/klmdactx.html
网友评论