ggq

package
v0.0.0-...-ea15551 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer[T any] interface {
	Consume([]T)
}

type GGQ

type GGQ[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](size uint32, consumer Consumer[T]) *GGQ[T]

func (*GGQ[T]) Awake

func (q *GGQ[T]) Awake()

Awake the queue if its in the idle state.

func (*GGQ[T]) Close

func (q *GGQ[T]) Close()

func (*GGQ[T]) Consume

func (q *GGQ[T]) Consume(lower, upper uint32)

func (*GGQ[T]) IsIdle

func (q *GGQ[T]) IsIdle() bool

func (*GGQ[T]) Read

func (q *GGQ[T]) Read() (T, bool)

ReadN gives way better performance, due to batching messages with lock os thread.

func (*GGQ[T]) ReadN

func (q *GGQ[T]) ReadN() (T, bool)

func (*GGQ[T]) Write

func (q *GGQ[T]) Write(val T)

Jump to

Keyboard shortcuts

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