Skip to content
/ pooli Public

Golang goroutine pool with dynamic size

License

Notifications You must be signed in to change notification settings

0x9n0p/pooli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pooli

Worker pool with dynamic size

	p := pooli.Open(context.Background(), pooli.Config{
		Goroutines: 5,
		Pipe:       make(chan pooli.Task),
	})
	p.Start()

	p.SendTask(pooli.NewTask(func(ctx context.Context) error {
		fmt.Println("task")
		return nil
	}))

	p.SetGoroutines(1)