Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkerQueue ¶
type WorkerQueue struct {
// contains filtered or unexported fields
}
func NewWorkerQueue ¶
func NewWorkerQueue(ctx context.Context, maxWorkers int) *WorkerQueue
func (*WorkerQueue) Go ¶
func (wq *WorkerQueue) Go(f func() error) error
Go starts a Go routine as a worker. If there are already maxWorkers running, it will block until one of them finishes
Remember to redefine variables in a loop before calling Go(). See pkg/repository/sync.go for an example.
func (*WorkerQueue) Wait ¶
func (wq *WorkerQueue) Wait() error
Wait until all workers have finished their work. Any errors returned by workers will be returned by this function.
Click to show internal directories.
Click to hide internal directories.