concurrent

package
v1.19.9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concurrent

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

func (*Concurrent) AsyncDo

func (c *Concurrent) AsyncDo(f func() bool, cb func(err error))

func (*Concurrent) AsyncDoByQueue

func (c *Concurrent) AsyncDoByQueue(queueId int64, fn func() bool, cb func(err error))

func (*Concurrent) Close

func (c *Concurrent) Close()

func (*Concurrent) DoCallback

func (d *Concurrent) DoCallback(cb func(err error))

func (*Concurrent) GetCallBackChannel

func (c *Concurrent) GetCallBackChannel() chan func(error)

func (*Concurrent) OpenConcurrent

func (c *Concurrent) OpenConcurrent(minGoroutineNum int32, maxGoroutineNum int32, maxTaskChannelNum int)

func (*Concurrent) OpenConcurrentByNumCPU

func (c *Concurrent) OpenConcurrentByNumCPU(cpuNumMul float32)

cpuMul 表示cpu的倍数 建议:(1)cpu密集型 使用1 (2)i/o密集型使用2或者更高

type IConcurrent

type IConcurrent interface {
	OpenConcurrentByNumCPU(cpuMul float32)
	OpenConcurrent(minGoroutineNum int32, maxGoroutineNum int32, maxTaskChannelNum int)
	AsyncDoByQueue(queueId int64, fn func() bool, cb func(err error))
	AsyncDo(f func() bool, cb func(err error))
}

Jump to

Keyboard shortcuts

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