daemon

package
v1.0.66 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Background

func Background(id int, args []string, conf Config, opts ...ArgOptionFunc) (*exec.Cmd, error)

func Group added in v0.8.3

func Group(group int, args []string, cb ProcessCallback, config Config, opts ...ArgOptionFunc)

Group 守护进程启动一个N[1,2000]子进程, 并循环监视

func Run

func Run(groupId int, args []string, cb ProcessCallback, config Config, opts ...ArgOptionFunc) int

Run 守护进程启动一个子进程, 并循环监视

Types

type ArgOption added in v1.0.66

type ArgOption struct {
	Id   int
	Args []string
	Env  []string
}

type ArgOptionFunc added in v1.0.66

type ArgOptionFunc func(arg *ArgOption)

type Config

type Config struct {
	system.Config
	MaxCount    int   `json:"maxCount" yaml:"maxCount" xml:"maxCount"`
	MaxError    int   `json:"maxError" yaml:"maxError" xml:"maxError"`
	MinExitTime int64 `json:"minExitTime" yaml:"minExitTime" xml:"minExitTime"`
}

type ProcessCallback

type ProcessCallback func(cmd *exec.Cmd, start bool, time int64)

Jump to

Keyboard shortcuts

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