This commit is contained in:
邹宗楠
2023-05-29 16:49:57 +08:00
parent 958ab4686d
commit d626fcf12d
3 changed files with 51 additions and 110 deletions

View File

@@ -8,7 +8,6 @@ import (
"strconv"
"strings"
"testing"
"time"
"unicode/utf8"
)
@@ -83,19 +82,3 @@ func TestTen216(t *testing.T) {
fmt.Println(gg)
fmt.Println(kk)
}
func TestSimplePool(t *testing.T) {
p := NewSimplePoll(20)
for i := 0; i < 100; i++ {
p.Add(parseTask(i))
}
p.Run()
}
func parseTask(i int) func() {
return func() {
// 模拟抓取数据的过程
time.Sleep(time.Second * 1)
fmt.Println("finish parse ", i)
}
}