ants

package
v0.0.0-...-47b6ad5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PoolSize = 10

PoolSize 协程池size

Variables

This section is empty.

Functions

func Cap

func Cap() int

Cap returns the capacity of this default pool.

func Free

func Free() int

Free returns the available goroutines to work.

func Go

func Go(task func())

Go submits a task to pool.

func Release

func Release()

Release Closes the default pool.

func Running

func Running() int

Running returns the number of the currently running goroutines.

func Submit

func Submit(task func()) error

Submit submits a task to pool.

Types

type Option

type Option = ant.Option

Option opt

type Pool

type Pool = ant.Pool

Pool pool

func DefaultPool

func DefaultPool() (p *Pool, err error)

DefaultPool 协程池

func NewPool

func NewPool(size int, opts ...Option) (*Pool, error)

NewPool 新建

type PoolWithFunc

type PoolWithFunc = ant.PoolWithFunc

PoolWithFunc PoolWithFunc

Jump to

Keyboard shortcuts

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