goroutine_pool

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Pool is a struct to represent goroutine pool.

func New

func New(idleTimeout time.Duration) *Pool

New returns a new *Pool object.

func (*Pool) Go

func (pool *Pool) Go(f func())

Go works like go func(), but goroutines are pooled for reusing. This strategy can avoid runtime.morestack, because pooled goroutine is already enlarged.

Jump to

Keyboard shortcuts

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