processor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LongestDurationForProcess defines the timeout interval for asynchronous event processing
	LongestDurationForProcess = 20 * time.Minute
)
View Source
const (
	// WorkersPerProcessor indicates the number of asynchronous threads for each type of event processing
	WorkersPerProcessor = 5
)

Variables

This section is empty.

Functions

func GetProcesses

func GetProcesses() map[string]IProcessor

GetProcesses returns the type of process

func StartAllProcessors

func StartAllProcessors(stopCh <-chan struct{})

StartAllProcessors start all register process

Types

type IProcessor

type IProcessor interface {
	List() ([]interface{}, error)
	Process(opType string, obj interface{})
	Run(stopCh <-chan struct{})
	ProcessType() string
	ProcessObject() interface{}
}

IProcessor is asynchronous thread interface

type Processor

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

Processor the struct of process attribute

func NewProcessor

func NewProcessor(name string, processorObj interface{}, handlerType handler.Type, resourceType resource.Type,
	workerCounts int, actionSets sets.String) *Processor

NewProcessor return the entity object of process

func (*Processor) List

func (p *Processor) List() ([]interface{}, error)

List implements watcher.Processor interface

func (*Processor) Process

func (p *Processor) Process(opType string, obj interface{})

Process implements watcher.Processor interface

func (*Processor) ProcessObject

func (p *Processor) ProcessObject() interface{}

ProcessObject return the object of process

func (*Processor) ProcessType

func (p *Processor) ProcessType() string

ProcessType return the process name

func (*Processor) Run

func (p *Processor) Run(stopCh <-chan struct{})

Run start to run process

Jump to

Keyboard shortcuts

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