queueEngine

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(chanLen int, fail ...Fail) *Engine

func (*Engine) Customer

func (e *Engine) Customer(callback func(Queue) bool)

消费异步

func (*Engine) CustomerWait added in v2.1.8

func (e *Engine) CustomerWait(callback func(Queue) bool)

消费

func (*Engine) Len

func (e *Engine) Len() int

等待消费数量

func (*Engine) Producer

func (e *Engine) Producer(data Queue)

生产

func (*Engine) ProducerFinish

func (e *Engine) ProducerFinish()

生产完成

type Fail

type Fail struct {
	Wait   time.Duration
	TryLen int
}

type Queue

type Queue struct {
	Data      interface{}
	FailCount int
}

Jump to

Keyboard shortcuts

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