pool

package
v0.0.0-...-47668b7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Work chan *Job // receives jobs to send to workers
	// contains filtered or unexported fields
}

func StartDispatcher

func StartDispatcher(workerCount int64) Collector

type Queue

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

func NewQueue

func NewQueue() *Queue

func (*Queue) Close

func (e *Queue) Close()

func (*Queue) Len

func (e *Queue) Len() int

Len returns the queue length. Safe for concurrent use.

func (*Queue) Pop

func (e *Queue) Pop() (v interface{})

Pop 取出队列,(阻塞模式)

func (*Queue) Push

func (e *Queue) Push(v interface{})

func (*Queue) TryPop

func (e *Queue) TryPop() (v interface{}, ok bool)

试着取出队列(非阻塞模式)返回ok == false 表示空

func (*Queue) Wait

func (e *Queue) Wait()

Wait blocks until the queue is empty or closed.

Jump to

Keyboard shortcuts

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