gmq

package
v0.0.0-...-df619d1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_QUEUE_CAP  = 4096
	MAX_QUEUE_NUMBER   = 4096
	MAX_MESSAGE_LENGHT = 40960
)

Variables

View Source
var QueueInstance map[string]QueueInterface

Functions

func GetQueueLength

func GetQueueLength(qname string) (int, error)

GetLenght: return the lenght of the queue if it exists in queueInstance or -1, err

func InitQueueInstance

func InitQueueInstance(dim int) map[string]QueueInterface

InitQueueInstance: init the singleton map used by the server

Types

type DbQueue

type DbQueue struct {
	Name, Vendor, Dsn string
	// contains filtered or unexported fields
}

func (DbQueue) Create

func (db DbQueue) Create(name string) (QueueInterface, error)

func (DbQueue) GetLength

func (db DbQueue) GetLength() (int, error)

func (DbQueue) Pop

func (db DbQueue) Pop() ([]byte, error)

func (DbQueue) Push

func (db DbQueue) Push(o []byte) error

type FsPrioQueue

type FsPrioQueue struct {
	Name, Path string
	File       *os.File
	// contains filtered or unexported fields
}

type FsQueue

type FsQueue struct {
	Name, Path string
	File       *os.File
	// contains filtered or unexported fields
}

func (FsQueue) Create

func (fs FsQueue) Create(name string) (QueueInterface, error)

func (FsQueue) GetLength

func (fs FsQueue) GetLength() (int, error)

func (FsQueue) Pop

func (fs FsQueue) Pop() ([]byte, error)

func (FsQueue) Push

func (fs FsQueue) Push(o []byte) error

type PrioQueue

type PrioQueue struct {
	QName string
	QObj  map[int]map[int][]byte
	// contains filtered or unexported fields
}

func (PrioQueue) Pop

func (q PrioQueue) Pop(prio int) []byte

func (PrioQueue) Push

func (q PrioQueue) Push(prio int, o []byte)

type Queue

type Queue struct {
	QName string
	QObj  map[int][]byte
	// contains filtered or unexported fields
}

func (Queue) Create

func (q Queue) Create(name string) (QueueInterface, error)

func (Queue) GetLength

func (q Queue) GetLength() (int, error)

func (*Queue) Init

func (q *Queue) Init(capacity int) *Queue

func (Queue) Pop

func (q Queue) Pop() ([]byte, error)

func (Queue) Push

func (q Queue) Push(o []byte) error

func (*Queue) Replace

func (q *Queue) Replace(obj map[int][]byte)

Replace: receive a QObj to replace the current queue

type QueueInterface

type QueueInterface interface {
	GetLength() (int, error)
	Create(string) (QueueInterface, error)
	Push([]byte) error
	Pop() ([]byte, error)
	// contains filtered or unexported methods
}

QueueInterface: the interface type describing the operations a queue must have

func GetQueue

func GetQueue(name string) QueueInterface

GetQueue: return the corresponding named queue in the QueueInstance map return nil if no queue with given name is present

Jump to

Keyboard shortcuts

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