1 Star 0 Fork 0

Yinux / go-learn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 530 Bytes
一键复制 编辑 原始数据 按行查看 历史
Yinux 提交于 2023-06-06 11:50 . 修改readme

GO 学习笔记

程序安装为系统服务

安装为系统服务,需要用到 service

限制goroutine数量

限制goroutine数量可以用管道的特性

goNum := make(chan bool,100)
for {
    goNum <- true
    go handleEvent()
}
func handleEvent() {
    defer func(){
        <-goNum
    }()
    // 执行业务逻辑
}

限流

限流可以用官方的rate

1
https://gitee.com/yinux/go-learn.git
git@gitee.com:yinux/go-learn.git
yinux
go-learn
go-learn
master

搜索帮助