sdconcur

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sdconcurr 并发/并行工具包

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPoolExpiry   = ants.ErrInvalidPoolExpiry
	ErrLackPoolFunc        = ants.ErrLackPoolFunc
	ErrPoolClosed          = ants.ErrPoolClosed
	ErrPoolOverload        = ants.ErrPoolOverload
	ErrInvalidPreAllocSize = ants.ErrInvalidPreAllocSize
)

Functions

func Bind

func Bind[T any](l []T, action func(int, T)) []func()

func Do

func Do[T any](n int, l []T, action func(int, T)) error

func DoFuncs

func DoFuncs(n int, actions []func()) error

func Lock

func Lock(mtx *sync.Mutex, action func())

func LockR

func LockR(mtx *sync.RWMutex, action func())

func LockW

func LockW(mtx *sync.RWMutex, action func())

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(size int, opts *PoolOptions) (*Pool, error)

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Do

func (p *Pool) Do(action func()) error

func (*Pool) NumCap

func (p *Pool) NumCap() int

func (*Pool) NumFree

func (p *Pool) NumFree() int

func (*Pool) NumRunning

func (p *Pool) NumRunning() int

func (*Pool) Submit

func (p *Pool) Submit(action func()) error

func (*Pool) Wrap

func (p *Pool) Wrap(action func()) func()

type PoolOptions

type PoolOptions = ants.Options

Jump to

Keyboard shortcuts

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