gp

package
Version: v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL