forwarder

package
v1.13.0-preview-2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbortingForwarder

type AbortingForwarder struct {
	BaseForwarder
}

AbortingForwarder is a forwarder which aborts all jobs instead of forwarding them

func NewAbortingForwarder

func NewAbortingForwarder(terminalErrFn func(error), schemaDB jobsdb.JobsDB, config *config.Config, log logger.Logger, stat stats.Stats) *AbortingForwarder

NewAbortingForwarder returns a new, properly initialized, AbortingForwarder

func (*AbortingForwarder) Start

func (nf *AbortingForwarder) Start() error

Start starts the forwarder which reads jobs from the database and aborts them

func (*AbortingForwarder) Stop

func (nf *AbortingForwarder) Stop()

Stop stops the forwarder

type BaseForwarder

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

func (*BaseForwarder) GetJobs

func (bf *BaseForwarder) GetJobs(ctx context.Context) ([]*jobsdb.JobT, bool, error)

GetJobs is an abstraction over the GetUnprocessed method of the jobsdb which includes retries

func (*BaseForwarder) GetSleepTime

func (bf *BaseForwarder) GetSleepTime(limitReached bool) time.Duration

GetSleepTime returns the sleep time based on the limitReached flag

func (*BaseForwarder) LoadMetaData

func (bf *BaseForwarder) LoadMetaData(terminalErrFn func(error), schemaDB jobsdb.JobsDB, log logger.Logger, config *config.Config, stat stats.Stats)

LoadMetaData loads the metadata required by the forwarders

func (*BaseForwarder) MarkJobStatuses

func (bf *BaseForwarder) MarkJobStatuses(ctx context.Context, statusList []*jobsdb.JobStatusT) error

MarkJobStatuses is an abstraction over the UpdateJobStatusInTx method of the jobsdb which includes retries

type JobsForwarder

type JobsForwarder struct {
	BaseForwarder
	// contains filtered or unexported fields
}

JobsForwarder is a forwarder that transforms and forwards jobs to a pulsar topic

func NewJobsForwarder

func NewJobsForwarder(terminalErrFn func(error), schemaDB jobsdb.JobsDB, client *pulsar.Client, config *config.Config, backendConfig backendconfig.BackendConfig, log logger.Logger, stat stats.Stats) *JobsForwarder

NewJobsForwarder returns a new, properly initialized, JobsForwarder

func (*JobsForwarder) Start

func (jf *JobsForwarder) Start() error

Start starts the forwarder which will start forwarding jobs from database to the appropriate pulsar topics

func (*JobsForwarder) Stop

func (jf *JobsForwarder) Stop()

Stop stops the forwarder

Jump to

Keyboard shortcuts

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