async

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_RUN  = 1
	STATUS_STOP = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Async

type Async struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewAsync

func NewAsync() *Async

func NewAsyncPool

func NewAsyncPool(size int) (rets []*Async)

func (*Async) Push

func (d *Async) Push(task func())

添加任务

func (*Async) Start

func (d *Async) Start()

开始actor任务协程

func (*Async) Stop

func (d *Async) Stop()

停止actor任务协程

type Queue

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

func NewQueue

func NewQueue() *Queue

func NewQueuePool

func NewQueuePool(size int64) (rets []*Queue)

func (*Queue) GetCount

func (d *Queue) GetCount() int64

func (*Queue) Pop

func (d *Queue) Pop() (ret interface{})

单协程安全

func (*Queue) Push

func (d *Queue) Push(val interface{})

多协程安全

Jump to

Keyboard shortcuts

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