workerpool

package
v0.0.0-...-04eba25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Work

type Work = func()

type WorkerPool

type WorkerPool struct {
	Size int
	// contains filtered or unexported fields
}

func NewWorkerPool

func NewWorkerPool(size int) *WorkerPool

NewWorkerPool returns a new WorkerPool, pool size is size.

func (*WorkerPool) Add

func (w *WorkerPool) Add(work Work)

Add adds a work to WorkerPool, asynchronously.

func (*WorkerPool) AddSync

func (w *WorkerPool) AddSync(work Work)

AddSync adds a work to WorkerPool, synchronously.

func (*WorkerPool) Wait

func (w *WorkerPool) Wait()

Wait waits for all tasks in workerpool to finish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL