
go并发
go啊go
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最新定时器功能代码传到github上
https://github.com/yy520ltm/godpt原创 2020-09-07 05:51:20 · 221 阅读 · 0 评论 -
关于在go并发五 中 存在的问题
在 函数 TestStopTimeUpdate() 中,有这样一句代码,是存放在每一个分类下面的 书籍,然后 key 为书籍的分类名,具体的 元素 []int 为 预设的分页码,这样就达到 每一类 下面 每次都能抓取 新的书籍内容。mapPage := make(map[string][]int)但是 在代码中 有 对这个分页map 有读和写 操作mapPage[tuName] = sliceInt......mapPage[tuName] = mapPage[tuName][1:len(m原创 2020-08-24 06:20:03 · 229 阅读 · 0 评论 -
golang 常用工具包
convertoperpackage convertoperimport ( "encoding/binary" "reflect" "unsafe")//byte数组转 int32func BytesToInt32(buf []byte) int32 { return int32(binary.BigEndian.Uint32(buf))}//byte数组转 int64func BytesToInt64(buf []byte) int64 { return int64(bi原创 2020-08-22 07:07:12 · 656 阅读 · 0 评论 -
go并发5 test 测试
test 包下面zonghengtimeupdateTest.go免责声明 在使用本程序时,本人以供读者学习使用,并没有攻击其他网站意图,请读者设置对应源码参数时酌情考虑,切记,切记package test//import ( "dao" "fmt" "mode" "strconv" "strings" "time" "tools/otheroper" "tools/reptilesoper/reptilesengine/gogo/dispatch" "tools/repti原创 2020-08-22 07:07:33 · 695 阅读 · 0 评论 -
go并发4 pools 协程池代码
pools包下pool.gopackage poolsimport ( "tools/reptilesoper/reptilesengine/gogo/timerupdate")type GoPools struct { PoolName string //协程池名称 GoWorkNum int //协程工作的数量 通过调度层哪边根据任务情况 来安排协原创 2020-08-22 07:08:06 · 240 阅读 · 0 评论 -
go并发3 timerupdate 包 定时更新器包
timerUpdate包 有三个文件tuclayer.go 定时更新器层tu.go 定时更新器task.go 任务tuclayer.go 定时更新器层package timerupdateimport ( "time")//Timing updater component layer//定时更新器组件层接口type TUCLayer struct { //定时器集合 TUs []*TimerUpdate}//创建定时器func CreateExcuTu(timerN原创 2020-08-21 07:59:49 · 338 阅读 · 0 评论 -
go并发2 dispatch 调度层包
//dispatch 调度层包分为三个文件centerdispatchlayer.go //调度层centerdispatch.go //调度器globals.go //全局类1:centerdispatchlayer.gopackage dispatchimport ( "fmt" "tools/reptilesoper/reptilesengine/gogo/pools" "tools/reptilesoper/reptilesengine/gogo/timerupdate"原创 2020-08-21 07:53:58 · 531 阅读 · 0 评论 -
golang 并发( 配合爬虫写的 并发小框架)
之前前面提到 爬虫 ,只是单纯的单条执行,既然用go来写爬虫,那么必须要用到 并发来做这件事情废话不多说,先上 设计图原创 2020-08-21 06:59:40 · 364 阅读 · 0 评论