events

package
v2.6.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bus added in v2.6.0

func Bus() (*eventsBus, string)

Types

type Event added in v2.6.0

type Event interface {
	Plugin() string
	Type() EventType
	Message() string
}

type EventBus added in v2.6.0

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 added in v2.6.0

type EventType uint32
const (
	// EventUnaryCallOk represents success unary call response
	EventUnaryCallOk EventType = iota

	// EventUnaryCallErr raised when unary call ended with error
	EventUnaryCallErr

	// EventPushOK thrown when new job has been added. JobEvent is passed as context.
	EventPushOK

	// EventPushError caused when job can not be registered.
	EventPushError

	// EventJobStart thrown when new job received.
	EventJobStart

	// EventJobOK thrown when job execution is successfully completed. JobEvent is passed as context.
	EventJobOK

	// EventJobError thrown on all job related errors. See JobError as context.
	EventJobError

	// EventPipeActive when pipeline has started.
	EventPipeActive

	// EventPipeStopped when pipeline has been stopped.
	EventPipeStopped

	// EventPipePaused when pipeline has been paused.
	EventPipePaused

	// EventPipeError when pipeline specific error happen.
	EventPipeError

	// EventDriverReady thrown when broken is ready to accept/serve tasks.
	EventDriverReady

	// EventWorkerConstruct thrown when new worker is spawned.
	EventWorkerConstruct

	// EventWorkerDestruct thrown after worker destruction.
	EventWorkerDestruct

	// EventSupervisorError triggered when supervisor can not complete work.
	EventSupervisorError

	// 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

	// EventPoolRestart triggered when pool restart is needed
	EventPoolRestart

	// EventWorkerError triggered after WorkerProcess. Except payload to be error.
	EventWorkerError
	// EventWorkerLog triggered on every write to WorkerProcess StdErr pipe (batched). Except payload to be []byte string.
	EventWorkerLog
	// EventWorkerStderr is the worker standard error output
	EventWorkerStderr
	// EventWorkerWaitExit is the worker exit event
	EventWorkerWaitExit
)

func (EventType) String added in v2.6.0

func (et EventType) String() string

type RREvent

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

func NewEvent added in v2.6.0

func NewEvent(t EventType, plugin string, msg string) *RREvent

NewEvent initializes new event

func (*RREvent) Message

func (r *RREvent) Message() string

func (*RREvent) Plugin

func (r *RREvent) Plugin() string

func (*RREvent) Type

func (r *RREvent) Type() EventType

Jump to

Keyboard shortcuts

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