pool

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package pool 无锁消息池,多读多写, 用于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
}

Pool None lock Message pool

func New

func New() *Pool

New : Create a pool

func (*Pool) ForEach

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

ForEach : Peek messages

func (*Pool) Get

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

Get : Take out a message

func (*Pool) Init

func (p *Pool) Init() *Pool

Init : Pool init.

func (*Pool) Put

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

Put a message in pool

func (*Pool) Size

func (p *Pool) Size() int32

Size : Count off message in pool

type SerialReadPool

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

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

func SerialNew

func SerialNew() *SerialReadPool

SerialNew Create a SerialReadPool

func (*SerialReadPool) ForEach

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

ForEach Peek messages

func (*SerialReadPool) Get

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

Get Take out a message

func (*SerialReadPool) Init

func (p *SerialReadPool) Init() *SerialReadPool

Init : init SerialReadPool

func (*SerialReadPool) Put

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

Put a message in pool

func (*SerialReadPool) Size

func (p *SerialReadPool) Size() int32

Size : Count of message in pool

Jump to

Keyboard shortcuts

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