testqueue

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

The Queue struct implements a multi-writer/multi-reader concurrent queue where the dequeue operation (the Get() method) takes a predicate that allows it to skip past queue entries until it finds one that satisfies the specified predicate.

func NewQueue

func NewQueue(t *testing.T, timeout time.Duration) *Queue

NewQueue constructs a new queue with the supplied timeout.

func (*Queue) Add

func (q *Queue) Add(t *testing.T, obj interface{})

Add an entry to the queue.

func (*Queue) AssertEmpty

func (q *Queue) AssertEmpty(t *testing.T, timeout time.Duration, msg string)

AssertEmpty will check that the queue remains empty for the supplied duration.

func (*Queue) Get

func (q *Queue) Get(t *testing.T, predicate func(interface{}) bool) (interface{}, error)

Get will return the next entry that satisfies the supplied predicate.

Jump to

Keyboard shortcuts

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