limit

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// EventMaxMemory caused when worker consumes more memory than allowed.
	EventMaxMemory = iota + 8000

	// EventTTL thrown when worker is removed due TTL being reached. Context is rr.WorkerError
	EventTTL

	// EventIdleTTL triggered when worker spends too much time at rest.
	EventIdleTTL

	// EventExecTTL triggered when worker spends too much time doing the task (max_execution_time).
	EventExecTTL
)
View Source
const ID = "limit"

ID defines controller service name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Interval defines the update duration for underlying controllers, default 1s.
	Interval time.Duration

	// Services declares list of services to be watched.
	Services map[string]*controllerConfig
}

Config of Limit service.

func (*Config) Controllers

func (c *Config) Controllers(l listener) (controllers map[string]roadrunner.Controller)

Controllers returns list of defined Services

func (*Config) Hydrate

func (c *Config) Hydrate(cfg service.Config) error

Hydrate must populate Config values using given Config source. Must return error if Config is not valid.

func (*Config) InitDefaults

func (c *Config) InitDefaults() error

InitDefaults sets missing values to their default values.

type Service

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

Service to control the state of rr service inside other services.

func (*Service) AddListener

func (s *Service) AddListener(l func(event int, ctx interface{}))

AddListener attaches server event controller.

func (*Service) Init

func (s *Service) Init(cfg *Config, c service.Container) (bool, error)

Init controller service

Jump to

Keyboard shortcuts

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