events

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 5 Imported by: 14 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

RoadRunner events bus

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEvent

func NewEvent(t fmt.Stringer, plugin string, message string) *event

NewEvent initializes new event

Types

type Bus

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

func NewEventBus

func NewEventBus() (*Bus, string)

func (*Bus) Len

func (eb *Bus) Len() uint

func (*Bus) Send

func (eb *Bus) Send(ev Event)

Send sends event to the events bus

func (*Bus) SubscribeAll

func (eb *Bus) SubscribeAll(subID string, ch chan<- Event) error

SubscribeAll for all RR events returns subscriptionID

func (*Bus) SubscribeP

func (eb *Bus) SubscribeP(subID string, pattern string, ch chan<- Event) error

SubscribeP pattern like "pluginName.EventType"

func (*Bus) Unsubscribe

func (eb *Bus) Unsubscribe(subID string)

func (*Bus) UnsubscribeP

func (eb *Bus) UnsubscribeP(subID, pattern string)

type Event

type Event interface {
	Type() fmt.Stringer
	Plugin() string
	Message() string
}

type EventBus

type EventBus interface {
	SubscribeAll(subID string, ch chan<- Event) error
	SubscribeP(subID string, pattern string, ch chan<- Event) error
	Unsubscribe(subID string)
	UnsubscribeP(subID, pattern string)
	Len() uint
	Send(ev Event)
}

type EventType

type EventType uint32
const (
	// EventWorkerConstruct thrown when new worker is spawned.
	EventWorkerConstruct EventType = iota
	// EventWorkerDestruct thrown after worker destruction.
	EventWorkerDestruct
	// EventWorkerProcessExit triggered on process wait exit
	EventWorkerProcessExit
	// EventNoFreeWorkers triggered when there are no free workers in the stack and timeout for worker allocate elapsed
	EventNoFreeWorkers
	// EventMaxMemory caused when worker consumes more memory than allowed.
	EventMaxMemory
	// EventTTL thrown when worker is removed due TTL being reached. TTL defines maximum time worker is allowed to live (seconds)
	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
	// EventWorkerError triggered after WorkerProcess. Except payload to be error.
	EventWorkerError
	// EventWorkerSoftError triggered after processing payload. This is not the panic/exception, we should not restart the worker.
	EventWorkerSoftError
	// EventWorkerStderr is the worker standard error output
	EventWorkerStderr
	// EventWorkerWaitExit is the worker exit event
	EventWorkerWaitExit
	// EventWorkerStopped triggered when worker gracefully stopped
	EventWorkerStopped
	// EventJOBSDriverCommand triggered when drivers wants to send event to the jobs plugin
	EventJOBSDriverCommand
)

func (EventType) String

func (et EventType) String() string

Jump to

Keyboard shortcuts

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