Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orestonce/gopool
go线程池
https://github.com/orestonce/gopool
Last synced: 23 days ago
JSON representation
go线程池
- Host: GitHub
- URL: https://github.com/orestonce/gopool
- Owner: orestonce
- License: bsd-2-clause
- Created: 2022-05-08T08:58:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-08T09:03:35.000Z (over 2 years ago)
- Last Synced: 2023-08-21T12:00:01.357Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go线程池使用方法
````go
package mainimport (
"fmt"
"github.com/orestonce/gopool"
)func main() {
task := gopool.NewThreadPool(10) // 最大线程数
task.AddJob(func() {
fmt.Println("thread1")
})
task.AddJob(func() {
fmt.Println("thread2")
})
task.CloseAndWait()
}
````