informer

package module
v4.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 6 Imported by: 2

README

Informer plugin (bundled)

It's used internally to report the worker's status and offer a high-level API for the RoadRunner-PHP packages.

Documentation

Index

Constants

View Source
const PluginName = "informer"

Variables

This section is empty.

Functions

This section is empty.

Types

type Informer

type Informer interface {
	Named
	Workers() []*process.State
}

Informer used to get workers from a particular plugin or set of plugins

type JobsStat

type JobsStat interface {
	Named
	// JobsState returns slice with the attached drivers information
	JobsState(ctx context.Context) ([]*jobs.State, error)
}

JobsStat interface provides statistic for the job plugin

type Named added in v4.3.4

type Named interface {
	// Name returns user-friendly name of the plugin
	Name() string
}

type Plugin

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

func (*Plugin) AddWorker added in v4.3.1

func (p *Plugin) AddWorker(plugin string) error

func (*Plugin) Collects

func (p *Plugin) Collects() []*dep.In

Collects declare services to be collected.

func (*Plugin) Init

func (p *Plugin) Init() error

func (*Plugin) Jobs

func (p *Plugin) Jobs(name string) []*jobs.State

Jobs provides information about jobs for the registered plugin using jobs

func (*Plugin) Name

func (p *Plugin) Name() string

Name of the service.

func (*Plugin) RPC

func (p *Plugin) RPC() any

RPC returns associated rpc service.

func (*Plugin) RemoveWorker added in v4.3.1

func (p *Plugin) RemoveWorker(plugin string) error

func (*Plugin) Workers

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

Workers provide BaseProcess slice with workers for the requested plugin

type WorkerList

type WorkerList struct {
	// Workers are list of workers.
	Workers []*process.State `json:"workers"`
}

WorkerList contains a list of workers.

func (*WorkerList) Len

func (w *WorkerList) Len() int

func (*WorkerList) Less

func (w *WorkerList) Less(i, j int) bool

func (*WorkerList) Swap

func (w *WorkerList) Swap(i, j int)

type WorkerManager added in v4.3.1

type WorkerManager interface {
	Named
	// RemoveWorker removes worker from the pool.
	RemoveWorker(ctx context.Context) error
	// AddWorker adds worker to the pool.
	AddWorker() error
}

Jump to

Keyboard shortcuts

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