_go

package
v0.0.0-...-3d82958 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExpiryDuration is the interval time to clean up those expired workers.
	ExpiryDuration = 10 * time.Second

	// Nonblocking decides what to do when submitting a new task to a full worker pool: waiting for a available worker
	// or returning nil directly.
	Nonblocking = true
)

Variables

View Source
var (
	// DefaultAntsPoolSize sets up the capacity of worker pool, 256 * 1024.
	DefaultAntsPoolSize = 1 << 18
)

Functions

func Init

func Init()

Init instantiates a non-blocking *WorkerPool with the capacity of DefaultAntsPoolSize.

func Release

func Release()

func Submit

func Submit(task func())

Types

type Pool

type Pool = ants.Pool

Pool is the alias of ants.Pool.

Jump to

Keyboard shortcuts

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