func SetRejectPolicy(rp RejectPolicy) Option {
	return func(config *Config) {
		config.rp = rp
	}
}
SetRejectPolicy defines which elements get discarded when the queue is full
package prosumer
import (
	"errors"
	"log"
	"time"
)
var (
	ErrDiscard       = errors.New("discard current element")
	ErrDiscardOldest = errors.New("discard oldest element")
)
type Element interface{}
type Consumer func(lst []Element) error
type Callback func([]Element, error)
type RejectPolicy int
const (
	Block RejectPolicy = iota
	Discard
	DiscardOldest
)
type Config struct {
	bufferSize int
	rp         RejectPolicy
	batchSize     int
	batchInterval time.Duration
	cb            Callback
	consumer    Consumer
	numConsumer int
}
func SetBufferSize(bufferSize int) Option {
	return func(config *Config) {
		config.bufferSize = bufferSize
	}
}