func NewBulkProcessorService(client *Client) *BulkProcessorService {
	return &BulkProcessorService{
		c:           client,
		numWorkers:  1,
		bulkActions: 1000,
		bulkSize:    5 << 20,  
		backoff: NewExponentialBackoff(
			time.Duration(200)*time.Millisecond,
			time.Duration(10000)*time.Millisecond,
		),
		retryItemStatusCodes: defaultRetryItemStatusCodes,
	}
}
NewBulkProcessorService creates a new BulkProcessorService.
package elastic
import (
	"context"
	"errors"
	"net"
	"sync"
	"sync/atomic"
	"time"
)
var (
	ErrBulkItemRetry = errors.New("elastic: uncommitted bulk response items")
	defaultRetryItemStatusCodes = []int{408, 429, 503, 507}
)
type BulkProcessorService struct {
	c                    *Client
	beforeFn             BulkBeforeFunc
	afterFn              BulkAfterFunc
	name                 string         
	numWorkers           int            
	bulkActions          int            
	bulkSize             int            
	flushInterval        time.Duration  
	wantStats            bool           
	backoff              Backoff        
	retryItemStatusCodes []int          
}