package
Version:
v0.9.0
Opens a new window with list of versions in this module.
Published: Oct 22, 2023
License: GPL-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 15
Opens a new window with list of known importers.
Documentation
¶
type Pool interface {
AddTask(t Task)
AddTasks(t []Task)
Start()
StartWithWorkerCreator(f func() (Worker, error)) error
Stop()
}
NewPool is used to create a new pool instance
type PoolConfig struct {
NumWorker int
QueueSize int
}
PoolConfig Configuration for a worker pool.
type Task interface {
WaitForResult() error
Execute()
ExecuteWithContext(ctx context.Context)
}
type Worker interface {
SetQueue(chan Task)
Start()
Stop()
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.