xworker

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker is used to control the concurrency of goroutines.

func NewWorker

func NewWorker(size int) *Worker

NewWorker returns a Worker.

func (*Worker) Run

func (w *Worker) Run(ctx context.Context, run func(), deferFunc func())

Run executes function with ctx control.

Jump to

Keyboard shortcuts

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