timer

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Locals = &LocalTasksT{M: make(map[int64]*Task)}

Functions

func Heartbeat

func Heartbeat()

func KillProcessByTaskID

func KillProcessByTaskID(id int64) error

Types

type LocalTasksT

type LocalTasksT struct {
	M map[int64]*Task
}

func (*LocalTasksT) AssignTask

func (lt *LocalTasksT) AssignTask(at dataobj.AssignTask)

func (*LocalTasksT) Clean

func (lt *LocalTasksT) Clean(assigned map[int64]struct{})

func (*LocalTasksT) GetTask

func (lt *LocalTasksT) GetTask(id int64) (*Task, bool)

func (*LocalTasksT) ReportTasks

func (lt *LocalTasksT) ReportTasks() []dataobj.ReportTask

func (*LocalTasksT) SetTask

func (lt *LocalTasksT) SetTask(t *Task)

type Task

type Task struct {
	sync.Mutex

	Id     int64
	Clock  int64
	Action string
	Status string

	Cmd    *exec.Cmd
	Stdout bytes.Buffer
	Stderr bytes.Buffer

	Args    string
	Account string
	// contains filtered or unexported fields
}

func (*Task) GetAlive

func (t *Task) GetAlive() bool

func (*Task) GetStatus

func (t *Task) GetStatus() string

func (*Task) GetStderr

func (t *Task) GetStderr() string

func (*Task) GetStdout

func (t *Task) GetStdout() string

func (*Task) ResetBuff

func (t *Task) ResetBuff()

func (*Task) SetAlive

func (t *Task) SetAlive(pa bool)

func (*Task) SetStatus

func (t *Task) SetStatus(status string)

Jump to

Keyboard shortcuts

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