jobs

package module
v2.18.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 28 Imported by: 1

README

Documentation

Index

Constants

View Source
const (
	// RrMode env variable
	RrMode     string = "RR_MODE"
	RrModeJobs string = "jobs"

	PluginName string = "jobs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// NumPollers configures number of priority queue pollers
	// Should be no more than 255
	// Default - num logical cores
	NumPollers uint8 `mapstructure:"num_pollers"`

	// PipelineSize is the limit of a main jobs queue which consume Items from the drivers pipeline
	// Driver pipeline might be much larger than a main jobs queue
	PipelineSize uint64 `mapstructure:"pipeline_size"`

	// Timeout in seconds is the per-push limit to put the job into queue
	Timeout int `mapstructure:"timeout"`

	// Pool configures roadrunner workers pool.
	Pool *poolImpl.Config `mapstructure:"Pool"`

	// Pipelines defines mapping between PHP job pipeline and associated job broker.
	Pipelines map[string]*pipeline.Pipeline `mapstructure:"pipelines"`

	// Consuming specifies names of pipelines to be consumed on service start.
	Consume []string `mapstructure:"consume"`
}

Config defines settings for job broker, workers and job-pipeline mapping.

func (*Config) InitDefaults

func (c *Config) InitDefaults()

type Plugin

type Plugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Plugin) CollectMQBrokers

func (p *Plugin) CollectMQBrokers(name endure.Named, c jobs.Constructor)

func (*Plugin) Collects

func (p *Plugin) Collects() []any

func (*Plugin) Declare

func (p *Plugin) Declare(pipeline *pipeline.Pipeline) error

Declare a pipeline.

func (*Plugin) Destroy

func (p *Plugin) Destroy(pp string) error

Destroy pipeline and release all associated resources.

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger, server server.Server) error

func (*Plugin) JobsState

func (p *Plugin) JobsState(ctx context.Context) ([]*jobs.State, error)

func (*Plugin) List

func (p *Plugin) List() []string

func (*Plugin) MetricsCollector

func (p *Plugin) MetricsCollector() []prometheus.Collector

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Pause

func (p *Plugin) Pause(pp string)

func (*Plugin) Push

func (p *Plugin) Push(j *jobs.Job) error

func (*Plugin) PushBatch

func (p *Plugin) PushBatch(j []*jobs.Job) error

func (*Plugin) RPC

func (p *Plugin) RPC() any

func (*Plugin) Reset

func (p *Plugin) Reset() error

func (*Plugin) Resume

func (p *Plugin) Resume(pp string)

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

func (*Plugin) Workers

func (p *Plugin) Workers() []*process.State

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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