func (q *pubQueue) Wait() (preparedPub, bool) {
	q.mu.Lock()
	if q.closed {
		q.mu.Unlock()
		return preparedPub{}, false
	}
	if q.cnt != 0 {
		q.mu.Unlock()
		return q.Remove()
	}
	q.cond.Wait()
	q.mu.Unlock()
	return q.Remove()
}
// Wait for a preparedPub to be added.
// If there is items on the queue the first will
// be returned immediately.
// Will return nil, false if the queue is closed.
// Otherwise the return value of "remove" is returned.
Wait for a preparedPub to be added.
If there is items on the queue the first will
be returned immediately.
Will return nil, false if the queue is closed.
Otherwise the return value of "remove" is returned.
// Wait for a preparedPub to be added . // If there is items on the queue the first will // be returned immediately . // Will return nil false if the queue is closed . // Otherwise the return value of " remove " is returned .
func (q *pubQueue) Wait() (preparedPub, bool) {
	q.mu.Lock()
	if q.closed {
		q.mu.Unlock()
		return preparedPub{}, false
	}
	if q.cnt != 0 {
		q.mu.Unlock()
		return q.Remove()
	}
	q.cond.Wait()
	q.mu.Unlock()
	return q.Remove()
}
func ( q * pubQueue ) Wait ( ) ( preparedPub , bool ) { q . mu . Lock ( ) if q . closed { q . mu . Unlock ( ) return preparedPub { } , false } if q . cnt != 0 { q . mu . Unlock ( ) return q . Remove ( ) } q . cond . Wait ( ) q . mu . Unlock ( ) return q . Remove ( ) }
Wait for a preparedPub to be added.
Wait for a preparedPub to be added .