pqueue

package module
v0.0.0-...-d39e9e8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

pqueue

Concurrent persistent message queue written in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	//
	Name string
}

type Message

type Message struct {
	Key   string
	Value interface{}
}

type PQueue

type PQueue struct {
	Config *PQueueConfig
	Queue  []*Message // TODO we are putting a LOT in memory Nova
	Count  int
	// contains filtered or unexported fields
}

func NewPQueue

func NewPQueue(cfg *PQueueConfig) *PQueue

func (*PQueue) Dequeue

func (q *PQueue) Dequeue() (*Message, error)

func (*PQueue) Empty

func (q *PQueue) Empty() error

func (*PQueue) Enqueue

func (q *PQueue) Enqueue(message *Message) error

func (*PQueue) Length

func (q *PQueue) Length() int

func (*PQueue) ListenAndServe

func (q *PQueue) ListenAndServe() error

func (*PQueue) Recover

func (q *PQueue) Recover() int

Recover will return the number of messages recovered from disk in the event of an outage.

func (*PQueue) String

func (q *PQueue) String() (string, error)

type PQueueClient

type PQueueClient struct {
	//
	Config *ClientConfig
}

func NewClient

func NewClient(cfg *ClientConfig) *PQueueClient

func (*PQueueClient) Connect

func (c *PQueueClient) Connect() error

type PQueueConfig

type PQueueConfig struct {
	//
	Name string
}

Directories

Path Synopsis
cmd
client command
service command

Jump to

Keyboard shortcuts

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