pool

package
v0.0.0-...-97150c2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: Apache-2.0 Imports: 6 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
	// contains filtered or unexported fields
}

func StartDispatcher

func StartDispatcher(workerCount int64) Collector

type Job

type Job struct {
	Data    interface{}
	JobFunc JobFunc
}

type JobFunc

type JobFunc func(id int64, data interface{})

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

func (*Queue) Pop

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

func (*Queue) Push

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

func (*Queue) TryPop

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

func (*Queue) Wait

func (e *Queue) Wait()

type Worker

type Worker struct {
	ID            int64
	WorkerChannel chan chan *Job
	Channel       chan *Job
	End           chan struct{}
	// contains filtered or unexported fields
}

func (*Worker) Start

func (w *Worker) Start()

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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