task

package
v0.0.0-...-f483c5f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWatch

func InitWatch()

Types

type ChangedFile

type ChangedFile struct {
	Name    string
	Changed int64
	Ext     string
	Event   string
}

type NetNotifier

type NetNotifier struct {
	CallUrl string
	CanPost bool
}

func (*NetNotifier) Put

func (n *NetNotifier) Put(cf *ChangedFile)

type PostParams

type PostParams struct {
	ProjectFolder string `json:"project_folder"`
	File          string `json:"file"`
	Changed       int64  `json:"changed"`
	Ext           string `json:"ext"`
	Event         string `json:"event"`
}

type Task

type Task struct {
	LastTaskID int64
	Delay      int
	Cmd        *exec.Cmd
	Notifier   *NetNotifier

	WaitChan  chan bool
	WaitQueue []*ChangedFile
	// contains filtered or unexported fields
}
var (
	TaskMan *Task
	Watcher *notify.Batcher
)

func NewTaskMan

func NewTaskMan(delay int, callURL string) *Task

init taskMan

func (*Task) PreRun

func (t *Task) PreRun(cf *ChangedFile)

直接结束旧进程

func (*Task) Put

func (t *Task) Put(cf *ChangedFile)

文件修改 转入

func (*Task) Run

func (t *Task) Run(cf *ChangedFile)

执行 exec

Jump to

Keyboard shortcuts

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