worker

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConsoleDone = "OSREAPI::CONSOLE::DONE"
View Source
const ConsoleStart = "OSREAPI::CONSOLE::START"

Variables

View Source
var (
	// DefaultSize 默认worker数为cpu核心数的两倍
	DefaultSize = runtime.NumCPU() * 2
)

Functions

func GetSize

func GetSize() int

func GetTotal added in v1.0.10

func GetTotal() int64

func Running

func Running() int64

func SetSize

func SetSize(n int)

func StopWait

func StopWait()

func Submit

func Submit(task *Task) error

func Waiting

func Waiting() int64

Types

type Task

type Task struct {
	ID       string
	Timeout  time.Duration
	MetaData types.MetaData
	Steps    []*TaskStep
	// contains filtered or unexported fields
}

type TaskStep

type TaskStep struct {
	ID             string
	CommandType    string
	CommandContent string
	EnvVars        []string
	DependsOn      []string
	Timeout        time.Duration
}

Jump to

Keyboard shortcuts

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