basic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 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 {
	// contains filtered or unexported fields
}

Pool of work coroutines struct

func NewPool

func NewPool(workers, queueSize int) *Pool

New goroutine pool with workers counts and capacity

func (*Pool) Close

func (p *Pool) Close()

Gracefully close the pool

func (*Pool) Submit

func (p *Pool) Submit(task Task) error

Submit tasks to the pool

func (*Pool) Work

func (pool *Pool) Work()

Worker goroutine

type Task

type Task func()

Task should be a function receive nothing and return nothing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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