tasks

package
v5.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueFull = errors.New("queue is full, data not pushed")

ErrQueueFull is returned when attempting to add data to a full queue

Functions

This section is empty.

Types

type DeferredRecordingTask

type DeferredRecordingTask interface {
	Stage(rawData interface{}) error
	tasks.Task
}

DeferredRecordingTask defines the interface for a task that accepts POSTs and submits them asyncrhonously

type DeferredRecordingTaskImpl

type DeferredRecordingTaskImpl struct {
	// contains filtered or unexported fields
}

DeferredRecordingTaskImpl is in charge of fetching impressions from the queue and posting them to the Split server BE

func NewEventsFlushTask

func NewEventsFlushTask(recorder *api.HTTPEventsRecorder, logger logging.LoggerInterface, period int, queueSize int, threads int) *DeferredRecordingTaskImpl

NewEventsFlushTask creates a new impressions flushing task

func NewImpressionCountFlushTask

func NewImpressionCountFlushTask(
	recorder *api.HTTPImpressionRecorder,
	logger logging.LoggerInterface,
	period int,
	queueSize int,
	threads int,
) *DeferredRecordingTaskImpl

NewImpressionCountFlushTask creates a new impressions flushing task

func NewImpressionsFlushTask

func NewImpressionsFlushTask(
	recorder *api.HTTPImpressionRecorder,
	logger logging.LoggerInterface,
	period int,
	queueSize int,
	threads int,
) *DeferredRecordingTaskImpl

NewImpressionsFlushTask creates a new impressions flushing task

func NewTelemetryConfigFlushTask

func NewTelemetryConfigFlushTask(recorder *api.HTTPTelemetryRecorder, logger logging.LoggerInterface, period int, queueSize int, threads int) *DeferredRecordingTaskImpl

NewTelemetryConfigFlushTask creates a new impressions flushing task

func NewTelemetryKeysClientSideFlushTask added in v5.2.0

func NewTelemetryKeysClientSideFlushTask(recorder *api.HTTPTelemetryRecorder, logger logging.LoggerInterface, period int, queueSize int, threads int) *DeferredRecordingTaskImpl

NewTelemetryKeysClientSideFlushTask creates a new flushing task

func NewTelemetryKeysServerSideFlushTask added in v5.2.0

func NewTelemetryKeysServerSideFlushTask(recorder *api.HTTPTelemetryRecorder, logger logging.LoggerInterface, period int, queueSize int, threads int) *DeferredRecordingTaskImpl

NewTelemetryKeysServerSideFlushTask creates a new flushing task

func NewTelemetryUsageFlushTask

func NewTelemetryUsageFlushTask(recorder *api.HTTPTelemetryRecorder, logger logging.LoggerInterface, period int, queueSize int, threads int) *DeferredRecordingTaskImpl

NewTelemetryUsageFlushTask creates a new impressions flushing task

func (*DeferredRecordingTaskImpl) IsRunning

func (t *DeferredRecordingTaskImpl) IsRunning() bool

IsRunning returns whether the task is running

func (*DeferredRecordingTaskImpl) Stage

func (t *DeferredRecordingTaskImpl) Stage(data interface{}) error

Stage queues impressions to be sent when the timer expires or the queue is filled.

func (*DeferredRecordingTaskImpl) Start

func (t *DeferredRecordingTaskImpl) Start()

Start starts the flushing task

func (*DeferredRecordingTaskImpl) Stop

func (t *DeferredRecordingTaskImpl) Stop(blocking bool) error

Stop stops the flushing task

type EventWorker

type EventWorker struct {
	// contains filtered or unexported fields
}

EventWorker defines a component capable of recording imrpessions in raw form

func (*EventWorker) Cleanup

func (w *EventWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*EventWorker) DoWork

func (w *EventWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*EventWorker) FailureTime

func (w *EventWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*EventWorker) Name

func (w *EventWorker) Name() string

Name returns the name of the worker

func (*EventWorker) OnError

func (w *EventWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type ImpressionCountWorker

type ImpressionCountWorker struct {
	// contains filtered or unexported fields
}

ImpressionCountWorker defines a component capable of recording imrpessions in raw form

func (*ImpressionCountWorker) Cleanup

func (w *ImpressionCountWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*ImpressionCountWorker) DoWork

func (w *ImpressionCountWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*ImpressionCountWorker) FailureTime

func (w *ImpressionCountWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*ImpressionCountWorker) Name

func (w *ImpressionCountWorker) Name() string

Name returns the name of the worker

func (*ImpressionCountWorker) OnError

func (w *ImpressionCountWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type ImpressionWorker

type ImpressionWorker struct {
	// contains filtered or unexported fields
}

ImpressionWorker defines a component capable of recording imrpessions in raw form

func (*ImpressionWorker) Cleanup

func (w *ImpressionWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*ImpressionWorker) DoWork

func (w *ImpressionWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*ImpressionWorker) FailureTime

func (w *ImpressionWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*ImpressionWorker) Name

func (w *ImpressionWorker) Name() string

Name returns the name of the worker

func (*ImpressionWorker) OnError

func (w *ImpressionWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type TelemetryConfigWorker

type TelemetryConfigWorker struct {
	// contains filtered or unexported fields
}

TelemetryConfigWorker defines a component capable of recording imrpessions in raw form

func (*TelemetryConfigWorker) Cleanup

func (w *TelemetryConfigWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*TelemetryConfigWorker) DoWork

func (w *TelemetryConfigWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*TelemetryConfigWorker) FailureTime

func (w *TelemetryConfigWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*TelemetryConfigWorker) Name

func (w *TelemetryConfigWorker) Name() string

Name returns the name of the worker

func (*TelemetryConfigWorker) OnError

func (w *TelemetryConfigWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type TelemetryKeysClientSideWorker added in v5.2.0

type TelemetryKeysClientSideWorker struct {
	// contains filtered or unexported fields
}

TelemetryKeysClientSideWorker defines a component capable of recording mtk client side in raw form

func (*TelemetryKeysClientSideWorker) Cleanup added in v5.2.0

func (w *TelemetryKeysClientSideWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*TelemetryKeysClientSideWorker) DoWork added in v5.2.0

func (w *TelemetryKeysClientSideWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*TelemetryKeysClientSideWorker) FailureTime added in v5.2.0

func (w *TelemetryKeysClientSideWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*TelemetryKeysClientSideWorker) Name added in v5.2.0

Name returns the name of the worker

func (*TelemetryKeysClientSideWorker) OnError added in v5.2.0

func (w *TelemetryKeysClientSideWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type TelemetryKeysServerSideWorker added in v5.2.0

type TelemetryKeysServerSideWorker struct {
	// contains filtered or unexported fields
}

TelemetryKeysServerSideWorker defines a component capable of recording mtk server side in raw form

func (*TelemetryKeysServerSideWorker) Cleanup added in v5.2.0

func (w *TelemetryKeysServerSideWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*TelemetryKeysServerSideWorker) DoWork added in v5.2.0

func (w *TelemetryKeysServerSideWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*TelemetryKeysServerSideWorker) FailureTime added in v5.2.0

func (w *TelemetryKeysServerSideWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*TelemetryKeysServerSideWorker) Name added in v5.2.0

Name returns the name of the worker

func (*TelemetryKeysServerSideWorker) OnError added in v5.2.0

func (w *TelemetryKeysServerSideWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type TelemetryUsageWorker

type TelemetryUsageWorker struct {
	// contains filtered or unexported fields
}

TelemetryUsageWorker defines a component capable of recording imrpessions in raw form

func (*TelemetryUsageWorker) Cleanup

func (w *TelemetryUsageWorker) Cleanup() error

Cleanup is called after the worker is shutdown

func (*TelemetryUsageWorker) DoWork

func (w *TelemetryUsageWorker) DoWork(message interface{}) error

DoWork is called and passed a message fetched from the work queue

func (*TelemetryUsageWorker) FailureTime

func (w *TelemetryUsageWorker) FailureTime() int64

FailureTime specifies how long to wait when an errors occurs before executing again

func (*TelemetryUsageWorker) Name

func (w *TelemetryUsageWorker) Name() string

Name returns the name of the worker

func (*TelemetryUsageWorker) OnError

func (w *TelemetryUsageWorker) OnError(e error)

OnError is called whenever theres an error in the worker function

type WorkerFactory

type WorkerFactory = func() workerpool.Worker

WorkerFactory defines the signature of a function for instantiating workers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL