pool

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

无锁消息池,多读多写, 用于goroutine 间收发消息

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func New

func New() *Pool

func (*Pool) ForEach

func (p *Pool) ForEach(cb func(v interface{}))

func (*Pool) Get

func (p *Pool) Get() (interface{}, bool)

func (*Pool) Init

func (p *Pool) Init() *Pool

func (*Pool) Put

func (p *Pool) Put(v interface{})

func (*Pool) Size

func (p *Pool) Size() int32

type SerialReadPool

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

无锁消息池,多写,有序单读(按写入时间排序)。适用于多个消息发送者,单个消息接收者模式

func SerialNew

func SerialNew() *SerialReadPool

func (*SerialReadPool) Get

func (p *SerialReadPool) Get() interface{}

func (*SerialReadPool) Init

func (p *SerialReadPool) Init() *SerialReadPool

func (*SerialReadPool) Put

func (p *SerialReadPool) Put(o interface{})

func (*SerialReadPool) Size

func (p *SerialReadPool) Size() int32

Jump to

Keyboard shortcuts

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