func SetMaxInMemArenas(maxInMemArenas int) Option {
	return func(c *bqConfig) error {
		if maxInMemArenas != 0 && maxInMemArenas < cMinMaxInMemArenas {
			return ErrTooFewInMemArenas
		}
		c.maxInMemArenas = maxInMemArenas
		return nil
	}
}
SetMaxInMemArenas returns an Option closure that sets maximum number of
Arenas that could reside in memory (RAM) at any time.  By default, all the
arenas reside in memory and Operating System takes care of memory by paging
in and out the pages from disk. A recommended value of maximum arenas that
should be in memory should be chosen such that:
maxInMemArenas > (# of consumers) * 2 + 1
package bigqueue
import (
	"errors"
	"os"
	"time"
)
const (
	cDefaultArenaSize = 128 * 1024 * 1024
	cMinMaxInMemArenas = 3
	cDefaultMutOps      = 1000000
	cDefaultflushPeriod = time.Second
)
var (
	ErrTooSmallArenaSize = errors.New("too small arena size")
	ErrTooFewInMemArenas = errors.New("too few in memory arenas")
)
type bqConfig struct {
	arenaSize      int
	maxInMemArenas int
	flushMutOps    int64
	flushPeriod    time.Duration
}
type Option func(*bqConfig) error
func newConfig() *bqConfig {
	return &bqConfig{
		arenaSize:      cDefaultArenaSize,
		maxInMemArenas: cMinMaxInMemArenas,
		flushMutOps:    cDefaultMutOps,
		flushPeriod:    cDefaultflushPeriod,
	}
}
func SetArenaSize(arenaSize int) Option {
	return func(c *bqConfig) error {
		if arenaSize < os.Getpagesize() {
			return ErrTooSmallArenaSize
		}
		c.arenaSize = arenaSize
		return nil
	}
}