pubqueue

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Topic   string
	Payload interface{}
}

type DropBehavior

type DropBehavior int
const (
	Oldest DropBehavior = iota
	Newest
	Unknown
)

func NewDropBehavior

func NewDropBehavior(b string) (DropBehavior, error)

func (DropBehavior) String

func (x DropBehavior) String() string

type Queue

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

func New

func New(maxSize int, dropBehavior DropBehavior) *Queue

func (*Queue) Enqueue

func (s *Queue) Enqueue(d *Data)

func (*Queue) Len

func (s *Queue) Len() int

func (*Queue) Pop

func (s *Queue) Pop() *Data

Jump to

Keyboard shortcuts

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