pipe

package
v0.4.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Infinity = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Hashable

type Hashable interface {
	GetHash() hashing.HashValue
}

type InfinitePipe

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

InfinitePipe provides deserialised sender and receiver: it queues messages sent by the sender and returns them to the receiver whenever it is ready, without blocking the sender process. Depending on the backing queue, the pipe might have other characteristics.

func (*InfinitePipe) Close

func (ch *InfinitePipe) Close()

func (*InfinitePipe) In

func (ch *InfinitePipe) In() chan<- interface{}

func (*InfinitePipe) Len

func (ch *InfinitePipe) Len() int

func (*InfinitePipe) Out

func (ch *InfinitePipe) Out() <-chan interface{}

type LimitedPriorityHashQueue

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

LimitedPriorityHashQueue is a queue, which can prioritize elements, limit its growth and reject already included elements.

func (*LimitedPriorityHashQueue) Add

func (q *LimitedPriorityHashQueue) Add(elem interface{}) bool

func (*LimitedPriorityHashQueue) Get

func (q *LimitedPriorityHashQueue) Get(i int) interface{}

Get returns the element at index i in the queue. If the index is invalid, the call will panic. This method accepts both positive and negative index values. Index 0 refers to the first element, and index -1 refers to the last.

func (*LimitedPriorityHashQueue) Length

func (q *LimitedPriorityHashQueue) Length() int

Length returns the number of elements currently stored in the queue.

func (*LimitedPriorityHashQueue) Peek

func (q *LimitedPriorityHashQueue) Peek() interface{}

Peek returns the element at the head of the queue. This call panics if the queue is empty.

func (*LimitedPriorityHashQueue) Remove

func (q *LimitedPriorityHashQueue) Remove() interface{}

Remove removes and returns the element from the front of the queue. If the queue is empty, the call will panic.

type Pipe

type Pipe interface {
	In() chan<- interface{}
	Out() <-chan interface{}
	Len() int
	Close()
}

func NewDefaultInfinitePipe

func NewDefaultInfinitePipe() Pipe

func NewHashInfinitePipe

func NewHashInfinitePipe() Pipe

func NewInfinitePipe

func NewInfinitePipe(priorityFun func(interface{}) bool, limit int) Pipe

func NewLimitHashInfinitePipe

func NewLimitHashInfinitePipe(limit int) Pipe

func NewLimitInfinitePipe

func NewLimitInfinitePipe(limit int) Pipe

func NewLimitPriorityInfinitePipe

func NewLimitPriorityInfinitePipe(priorityFun func(interface{}) bool, limit int) Pipe

func NewPriorityHashInfinitePipe

func NewPriorityHashInfinitePipe(priorityFun func(interface{}) bool) Pipe

func NewPriorityInfinitePipe

func NewPriorityInfinitePipe(priorityFun func(interface{}) bool) Pipe

type Queue

type Queue interface {
	Length() int
	Add(elem interface{}) bool
	Peek() interface{}
	Get(i int) interface{}
	Remove() interface{}
}

func NewDefaultLimitedPriorityHashQueue

func NewDefaultLimitedPriorityHashQueue() Queue

func NewHashLimitedPriorityHashQueue

func NewHashLimitedPriorityHashQueue(hashNeeded bool) Queue

func NewLimitHashLimitedPriorityHashQueue

func NewLimitHashLimitedPriorityHashQueue(limit int, hashNeeded bool) Queue

func NewLimitLimitedPriorityHashQueue

func NewLimitLimitedPriorityHashQueue(limit int) Queue

func NewLimitPriorityLimitedPriorityHashQueue

func NewLimitPriorityLimitedPriorityHashQueue(priorityFun func(interface{}) bool, limit int) Queue

func NewLimitedPriorityHashQueue

func NewLimitedPriorityHashQueue(priorityFun func(interface{}) bool, limit int, hashNeeded bool) Queue

func NewPriorityHashLimitedPriorityHashQueue

func NewPriorityHashLimitedPriorityHashQueue(priorityFun func(interface{}) bool, hashNeeded bool) Queue

func NewPriorityLimitedPriorityHashQueue

func NewPriorityLimitedPriorityHashQueue(priorityFun func(interface{}) bool) Queue

type SimpleHashable

type SimpleHashable int

func (SimpleHashable) GetHash

func (sh SimpleHashable) GetHash() hashing.HashValue

Jump to

Keyboard shortcuts

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