func NewHTTPEventDispatcher(sdkKey string, requester *utils.HTTPRequester, logger logging.OptimizelyLogProducer) Dispatcher {
	if requester == nil {
		requester = utils.NewHTTPRequester(logging.GetLogger(sdkKey, "HTTPRequester"))
	}
	if logger == nil {
		logger = logging.GetLogger(sdkKey, "httpEventDispatcher")
	}
	return &httpEventDispatcher{requester: requester, logger: logger}
}
NewHTTPEventDispatcher creates a full http dispatcher. The requester and logger parameters can be nil.
package event
import (
	"fmt"
	"net/http"
	"time"
	"golang.org/x/sync/semaphore"
	"github.com/optimizely/go-sdk/pkg/logging"
	"github.com/optimizely/go-sdk/pkg/metrics"
	"github.com/optimizely/go-sdk/pkg/utils"
)
const maxWorkers = int64(1)
const maxRetries = 3
const defaultQueueSize = 1000
const sleepTime = 1 * time.Second
type Dispatcher interface {
	DispatchEvent(event LogEvent) (bool, error)
}
type httpEventDispatcher struct {
	requester *utils.HTTPRequester
	logger    logging.OptimizelyLogProducer
}
func (ed *httpEventDispatcher) DispatchEvent(event LogEvent) (bool, error) {
	_, _, code, err := ed.requester.Post(event.EndPoint, event.Event)
	var success bool
	if err != nil {
		ed.logger.Error("http.Post failed:", err)
		success = false
	} else {
		if code == http.StatusNoContent {
			success = true
		} else {
			ed.logger.Error(fmt.Sprintf("http.Post invalid response %d", code), nil)
			success = false
		}
	}
	return success, err
}