Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group interface { // Enqueue queues a work function to be executed by the group. It does not // block and the WorkFunc should be assumed to execute in another goroutine. Enqueue(WorkFunc) }
Group is a group of workers that can execute work.
type GroupWorkPool ¶
type GroupWorkPool interface { // AddGroup adds a new group to the pool. Cancellation of the provided // context will cause the group to be removed from the pool. AddGroup(context.Context) Group // Start starts the pool. Cancellation of the provided context will cause // the pool to stop. Start(context.Context) // Stop stops the pool. Will have the same effect as cancelling the context // passed to Start. Stop() }
GroupWorkPool is a worker pool with a fixed number of workers. The pool executes work in groups. Each group has a fixed maximum number of workers it can use.
func New ¶
func New(totalWorkers, workersPerGroup int) GroupWorkPool
New creates a new GroupWorkPool with the given number of total workers and total workers per group.
Click to show internal directories.
Click to hide internal directories.