1 Star 0 Fork 0

mosache / go-zero

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
donechan.go 396 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevwan 提交于 2020-08-08 16:40 . update package reference
package syncx
import (
"sync"
"github.com/tal-tech/go-zero/core/lang"
)
type DoneChan struct {
done chan lang.PlaceholderType
once sync.Once
}
func NewDoneChan() *DoneChan {
return &DoneChan{
done: make(chan lang.PlaceholderType),
}
}
func (dc *DoneChan) Close() {
dc.once.Do(func() {
close(dc.done)
})
}
func (dc *DoneChan) Done() chan lang.PlaceholderType {
return dc.done
}
1
https://gitee.com/mosache/go-zero.git
git@gitee.com:mosache/go-zero.git
mosache
go-zero
go-zero
dfb45c801a6c

搜索帮助

53164aa7 5694891 3bd8fe86 5694891