util

package
v2.0.0-alpha21 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateListener

func CreateListener(address string) (net.Listener, error)

CreateListener crates socket listener based on DSN definition.

func ExecuteFromUser

func ExecuteFromUser(cmd *exec.Cmd, u string) error

ExecuteFromUser may work only if run RR under root user

func IsolateProcess

func IsolateProcess(cmd *exec.Cmd)

IsolateProcess change gpid for the process to avoid bypassing signals to php processes.

Types

type EventHandler

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

EventHandler helps to broadcast events to multiple listeners.

func (*EventHandler) AddListener

func (eb *EventHandler) AddListener(listener EventListener)

AddListener registers new event listener.

func (*EventHandler) NumListeners

func (eb *EventHandler) NumListeners() int

NumListeners returns number of event listeners.

func (*EventHandler) Push

func (eb *EventHandler) Push(e interface{})

Push broadcast events across all event listeners.

type EventListener

type EventListener func(event interface{})

Event listener listens for the events produced by worker, worker pool or other servce.

type EventsHandler

type EventsHandler interface {
	NumListeners() int
	AddListener(listener EventListener)
	Push(e interface{})
}

func NewEventsHandler

func NewEventsHandler() EventsHandler

Jump to

Keyboard shortcuts

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