Skip to content

xEasy/pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

autopool: 自动伸缩池,指定最小和最大连接,按需增加

workerpool: 工人令牌池,指定工人数和队列,池创建就已初始化工人数

Usage:

import (
  "fmt"
	"github.com/xEasy/pool/workerpool"
)

pool := workerpool.NewPool(WORKER_COUNT, JOB_QUEUE_LEGTH)

func helloWorld(w string) {
  fmt.Print("hello", w)
}

pool.WaitCount(1)
pool.Enqueue(helloWorld, "world")
pool.WaitAll()

# release workpool
pool.Release()

About

golang work pool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages