func (q *MaxQueue) Len() int {
	q.lock.RLock()
	defer q.lock.RUnlock()
	return q.queue.Len()
}
Len returns the number of items in the maxqueue
package maxqueue
import (
	"fmt"
	"sync"
	"github.com/danrl/golibby/queue"
)
type MaxQueue struct {
	lock   sync.RWMutex
	queue  queue.Queue
	maxlen int
}
var (
	ErrorEmpty = fmt.Errorf("empty queue")
	ErrorFull = fmt.Errorf("full queue")
	ErrorIllegalLength = fmt.Errorf("illegal legnth")
)
func New(maxlen int) (*MaxQueue, error) {
	if maxlen < 1 {
		return nil, ErrorIllegalLength
	}
	return &MaxQueue{
		maxlen: maxlen,
	}, nil
}