func New(opts ...Option) (*Outboxer, error) {
	o := Outboxer{
		errChan:          make(chan error),
		okChan:           make(chan struct{}),
		messageBatchSize: 100,
		cleanUpBatchSize: 100,
	}

	for _, opt := range opts {
		opt(&o)
	}

	if o.ds == nil {
		return nil, ErrMissingDataStore
	}

	if o.es == nil {
		return nil, ErrMissingEventStream
	}

	return &o, nil
}
// New creates a new instance of Outboxer
New creates a new instance of Outboxer
// New creates a new instance of Outboxer
func New(opts ...Option) (*Outboxer, error) {
	o := Outboxer{
		errChan:          make(chan error),
		okChan:           make(chan struct{}),
		messageBatchSize: 100,
		cleanUpBatchSize: 100,
	}
	for _, opt := range opts {
		opt(&o)
	}
	if o.ds == nil {
		return nil, ErrMissingDataStore
	}
	if o.es == nil {
		return nil, ErrMissingEventStream
	}
	return &o, nil
}
func New ( opts ... Option ) ( * Outboxer , error ) { o := Outboxer { errChan : make ( chan error ) , okChan : make ( chan struct { } ) , messageBatchSize : 100 , cleanUpBatchSize : 100 , } for _ , opt := range opts { opt ( & o ) } if o . ds == nil { return nil , ErrMissingDataStore } if o . es == nil { return nil , ErrMissingEventStream } return & o , nil }
New creates a new instance of Outboxer
New creates a new instance of Outboxer