queue

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueClosed = errors.New("queue is closed")

Functions

func NewPressureQueue

func NewPressureQueue(keyFunc KeyFunc) *pressurequeue

Types

type ActionType

type ActionType string
const (
	Added   ActionType = "Added"
	Updated ActionType = "Updated"
	Deleted ActionType = "Deleted"
)

type Event

type Event struct {
	Action ActionType
	Object interface{}
	// contains filtered or unexported fields
}

func (Event) GetReputCount

func (event Event) GetReputCount() int

type EventQueue

type EventQueue interface {
	Add(obj interface{}) error
	Update(obj interface{}) error
	Delete(obj interface{}) error

	Pop() (*Event, error)
	Done(event *Event) error

	Len() int
	DiscardAndRetain(retain int) bool

	Close()
}

type KeyFunc

type KeyFunc func(obj interface{}) (string, error)

Jump to

Keyboard shortcuts

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