func (t *Tracker) BlockingFlush(flushAttempts int, flushSleepTimeMs int) int {
	t.waitForEmitter(flushSleepTimeMs)
	rowCount := 0
	attemptCount := 0
	for {
		rowCount = len(t.Emitter.Storage.GetAllEventRows())
		if attemptCount >= flushAttempts || rowCount == 0 {
			break
		} else {
			t.FlushEmitter()
			t.waitForEmitter(flushSleepTimeMs)
			attemptCount++
		}
	}
	return rowCount
}
BlockingFlush will block the executing thread until the tracker has fired all events
from the queue.  Useful for short-lived applications that have to wait for events to
be fired.
package tracker
import (
	"time"
)
const (
	DEFAULT_PLATFORM = "srv"
	DEFAULT_BASE_64  = true
)
type Tracker struct {
	Emitter      *Emitter
	Subject      *Subject
	Namespace    string
	AppId        string
	Platform     string
	Base64Encode bool
}
func InitTracker(options ...func(*Tracker)) *Tracker {
	t := &Tracker{}
	t.Platform = DEFAULT_PLATFORM
	t.Base64Encode = DEFAULT_BASE_64
	for _, op := range options {
		op(t)
	}
	if t.Emitter == nil {
		panic("FATAL: Emitter cannot be nil.")
	}
	return t
}
func RequireEmitter(emitter *Emitter) func(t *Tracker) {
	return func(t *Tracker) { t.Emitter = emitter }
}
func OptionSubject(subject *Subject) func(t *Tracker) {
	return func(t *Tracker) { t.Subject = subject }
}
func OptionNamespace(namespace string) func(t *Tracker) {
	return func(t *Tracker) { t.Namespace = namespace }
}
func OptionAppId(appId string) func(t *Tracker) {
	return func(t *Tracker) { t.AppId = appId }
}
func OptionPlatform(platform string) func(t *Tracker) {
	return func(t *Tracker) { t.Platform = platform }
}
func OptionBase64Encode(base64Encode bool) func(t *Tracker) {
	return func(t *Tracker) { t.Base64Encode = base64Encode }
}
func (t Tracker) FlushEmitter() {
	t.Emitter.Flush()
}
func (t *Tracker) waitForEmitter(flushSleepTimeMs int) {
	for {
		if !t.Emitter.IsSending() || t.Emitter.SendChannel == nil {
			break
		}
		time.Sleep(time.Duration(flushSleepTimeMs) * time.Millisecond)
	}
}