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.
type Queue struct {
// contains filtered or unexported fields
}
func NewQueue(t *testing.T, timeout time.Duration) *Queue
NewQueue constructs a new queue with the supplied timeout.
func (q *Queue) Add(t *testing.T, obj interface{})
Add an entry to the queue.
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 (q *Queue) Get(t *testing.T, predicate func(interface{}) bool) (interface{}, error)
Get will return the next entry that satisfies the supplied predicate.