pool

package
v0.0.0-...-1a1a4f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoPool

type GoPool struct {
	MaxLimit int
	// contains filtered or unexported fields
}

func NewGoPool

func NewGoPool(options ...GoPoolOption) *GoPool

func (*GoPool) Submit

func (gp *GoPool) Submit(fn func())

Submit will wait a token, and then execute fn

func (*GoPool) Wait

func (gp *GoPool) Wait()

Wait will wait all the tasks executed, and then return

type GoPoolOption

type GoPoolOption func(*GoPool)

func WithMaxLimit

func WithMaxLimit(max int) GoPoolOption

Jump to

Keyboard shortcuts

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