queue

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUEUE_CMD_SHOW = iota
	QUEUE_CMD_MONITOR_ON
	QUEUE_CMD_MONITOR_OFF
	QUEUE_CMD_CLEAR
)

Variables

This section is empty.

Functions

func RegisterCommand

func RegisterCommand(moduleId debug.ModuleId, queueNames []string) *cobra.Command

Types

type Manager

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

func NewManager

func NewManager(module debug.ModuleId) *Manager

func (*Manager) NewQueue

func (m *Manager) NewQueue(name string, size int, options ...queue.Option) *Queue

func (*Manager) NewQueueUnmarshal

func (m *Manager) NewQueueUnmarshal(name string, size int, unmarshaller Unmarshaller, options ...queue.Option) *Queue

func (*Manager) NewQueues

func (m *Manager) NewQueues(name string, size, count, userCount int, options ...queue.Option) *MultiQueue

func (*Manager) NewQueuesUnmarshal

func (m *Manager) NewQueuesUnmarshal(name string, size, count, userCount int, unmarshaller Unmarshaller, options ...queue.Option) *MultiQueue

func (*Manager) RecvCommand

func (m *Manager) RecvCommand(conn *net.UDPConn, remote *net.UDPAddr, operate uint16, arg *bytes.Buffer)

type Monitor

type Monitor struct {
	DebugOn bool
	Name    string
	// contains filtered or unexported fields
}

func (*Monitor) TurnOffDebug

func (m *Monitor) TurnOffDebug()

func (*Monitor) TurnOnDebug

func (m *Monitor) TurnOnDebug(conn *net.UDPConn, remote *net.UDPAddr)

type MonitorOperator

type MonitorOperator interface {
	TurnOnDebug(conn *net.UDPConn, remote *net.UDPAddr)
	TurnOffDebug()
}

type MultiQueue

type MultiQueue struct {
	queue.FixedMultiQueue
	*Monitor
	// contains filtered or unexported fields
}

func (*MultiQueue) Get

func (q *MultiQueue) Get(key queue.HashKey) interface{}

func (*MultiQueue) Gets

func (q *MultiQueue) Gets(key queue.HashKey, output []interface{}) int

func (*MultiQueue) Init

func (q *MultiQueue) Init(name string, size, count, userCount int, unmarshaller Unmarshaller, options ...queue.Option)

func (*MultiQueue) Len

func (q *MultiQueue) Len(key queue.HashKey) int

func (*MultiQueue) Put

func (q *MultiQueue) Put(key queue.HashKey, items ...interface{}) error

func (*MultiQueue) Puts

func (q *MultiQueue) Puts(keys []queue.HashKey, items []interface{}) error

The userId key must be placed in keys[0] (with item keys)

func (*MultiQueue) Readers

func (q *MultiQueue) Readers() []queue.QueueReader

func (*MultiQueue) Writers

func (q *MultiQueue) Writers() []queue.QueueWriter

type Queue

type Queue struct {
	*queue.OverwriteQueue
	*Monitor
}

func (*Queue) Get

func (q *Queue) Get() interface{}

func (*Queue) Gets

func (q *Queue) Gets(output []interface{}) int

func (*Queue) Init

func (q *Queue) Init(name string, size int, unmarshaller Unmarshaller, options ...queue.Option)

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Put

func (q *Queue) Put(items ...interface{}) error

type ReferenceCountable

type ReferenceCountable interface {
	AddReferenceCount()
	SubReferenceCount() bool
}

type Unmarshaller

type Unmarshaller func(interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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