worker

package
v1.7.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultJobBackOff is the default backoff period
	DefaultJobBackOff = 1 * time.Second
	// MaxJobBackOff is the max backoff period
	MaxJobBackOff = 360 * time.Second
)

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	AddEventHandler(handler cache.ResourceEventHandler)
}

type MetricsReporter

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

MetricsReporter reports metrics of a workflow to pipeline server.

func NewMetricsReporter

func NewMetricsReporter(pipelineClient client.PipelineClientInterface) *MetricsReporter

NewMetricsReporter creates a new instance of NewMetricsReporter.

func (MetricsReporter) ReportMetrics

func (r MetricsReporter) ReportMetrics(workflow *util.Workflow) error

ReportMetrics reports workflow metrics to pipeline server.

type PersistenceWorker

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

PersistenceWorker is a generic worker to persist objects from a queue.

func NewPersistenceWorker

func NewPersistenceWorker(
	time util.TimeInterface,
	name string,
	eventHandler EventHandler,
	enforceRequeueDelays bool,
	saver Saver) *PersistenceWorker

NewPersistenceWorker returns a new PersistenceWorker

func (*PersistenceWorker) Len

func (p *PersistenceWorker) Len() int

func (*PersistenceWorker) RunWorker

func (p *PersistenceWorker) RunWorker()

RunWorker is a long-running function that will continually call the processNextWorkItem function in order to read and process a message on the workqueue. It enforces that the syncHandler is never invoked concurrently with the same key.

func (*PersistenceWorker) Shutdown

func (p *PersistenceWorker) Shutdown()

type Saver

type Saver interface {
	Save(key string, namespace string, name string, nowEpoch int64) error
}

type ScheduledWorkflowSaver

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

ScheduledWorkflowSaver provides a function to persist a workflow to a database.

func (*ScheduledWorkflowSaver) Save

func (c *ScheduledWorkflowSaver) Save(key string, namespace string, name string, nowEpoch int64) error

type WorkflowSaver

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

WorkflowSaver provides a function to persist a workflow to a database.

func NewWorkflowSaver

func NewWorkflowSaver(client client.WorkflowClientInterface,
	pipelineClient client.PipelineClientInterface, ttlSecondsAfterWorkflowFinish int64) *WorkflowSaver

func (*WorkflowSaver) Save

func (s *WorkflowSaver) Save(key string, namespace string, name string, nowEpoch int64) error

Jump to

Keyboard shortcuts

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