# go-agopool **Repository Path**: g_night/go-agopool ## Basic Information - **Project Name**: go-agopool - **Description**: Goroutine 协程池实现 控制协程数目 分为阻塞式 和 非阻塞模式 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-06-10 - **Last Updated**: 2024-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: go-main ## README # go-agopool #### 介绍 Goroutine 协程池实现 控制协程数目 分为阻塞式 和 非阻塞模式 ```go func demo() { pool := agopool.NewPool() var sum int64 = 0 add := func(v ...interface{}) { atomic.AddInt64(&sum, 1) } for i := 1; i < 1000000; i++ { pool.Put(add, nil, nil) } pool.Close() fmt.Println("demo = ", sum) } ```