pool

package
v0.0.0-...-5b05609 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAntsPoolSize sets up the capacity of worker pool.
	DefaultAntsPoolSize = 256 * 1024

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

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

Variables

This section is empty.

Functions

func PutBytes

func PutBytes(buf []byte)

PutBytes put bytes back to pool.

Types

type BytesPool

type BytesPool = pbytes.Pool

BytesPool is the alias of pbytes.Pool.

func NewBytesPool

func NewBytesPool() *BytesPool

NewBytesPool instantiates a *BytesPool that reuses slices which size is in logarithmic range [Lower, Upper].

type WorkerPool

type WorkerPool = ants.Pool

WorkerPool is the alias of ants.Pool.

func NewWorkerPool

func NewWorkerPool() *WorkerPool

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

Jump to

Keyboard shortcuts

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