buffer

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unbounded

type Unbounded struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Unbounded 一个支持任意长度的channel实现 如果有性能要求,将interface类型实例出来,避免一次转换。

func NewUnbounded

func NewUnbounded() *Unbounded

NewUnbounded 构建Unbounded

func (*Unbounded) Get

func (b *Unbounded) Get() <-chan interface{}

Get 获取unbounded的读channel

func (*Unbounded) Load

func (b *Unbounded) Load()

Load 将积压队列中的头部数据提取到channel,并将队列整体前移一位。

func (*Unbounded) Put

func (b *Unbounded) Put(t interface{})

Put 输入一个新的信息

Jump to

Keyboard shortcuts

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