Versions in this module Expand all Collapse all v0 v0.5.0-alpha.2 Dec 21, 2024 v0.5.0-alpha.1 Nov 3, 2024 v0.5.0-alpha Jun 5, 2023 v0.4.16 Feb 28, 2024 v0.4.15 Jan 10, 2024 v0.4.14 Jun 4, 2023 v0.4.13 Mar 25, 2023 v0.4.12 Feb 28, 2023 v0.4.11 Feb 5, 2023 v0.4.10 Nov 21, 2022 v0.4.9 Nov 12, 2022 v0.4.8 Oct 11, 2022 v0.4.7 Sep 13, 2022 v0.4.6 Aug 15, 2022 Changes in this version + type JobsAllocator struct + func NewConstantJobsAllocator(num int) *JobsAllocator + func (allocator *JobsAllocator) AvailableJobs(tracker *Task) int + func (allocator *JobsAllocator) Init() + func (allocator *JobsAllocator) MaxJobs() int + type JobsScheduler struct + func NewJobsScheduler(num int) *JobsScheduler + func (s *JobsScheduler) GetJobsAllocator(taskName string) *JobsAllocator + func (s *JobsScheduler) Register(taskName string, priority int, privileged bool) bool + func (s *JobsScheduler) Unregister(taskName string) v0.4.5 Jul 9, 2022 Changes in this version + type Monitor struct + TaskLock sync.Mutex + Tasks map[string]*Task + func NewTaskMonitor() *Monitor + func (tm *Monitor) Add(name string, done int) + func (tm *Monitor) Fail(name, err string) + func (tm *Monitor) Finish(name string) + func (tm *Monitor) Get(name string) int + func (tm *Monitor) GetTask(name string) *Task + func (tm *Monitor) List(workers ...string) []Task + func (tm *Monitor) Pending(name string) + func (tm *Monitor) Start(name string, total int) *Task + func (tm *Monitor) Suspend(name string, flag bool) + func (tm *Monitor) Update(name string, done int) + type Runner struct + Name string + func (locker *Runner) Lock() + func (locker *Runner) UnLock() + type Scheduler struct + Privileged *strset.Set + Running bool + func NewTaskScheduler() *Scheduler + func (t *Scheduler) Lock(name string) + func (t *Scheduler) NewRunner(name string) *Runner + func (t *Scheduler) PreLock(name string) + func (t *Scheduler) UnLock(name string) + type Status string + const StatusComplete + const StatusFailed + const StatusPending + const StatusRunning + const StatusSuspended + type SubTask struct + End int + Parent *Task + Start int + func (t *SubTask) Add(done int) + func (t *SubTask) Finish() + type Task struct + Done int + Error string + FinishTime time.Time + Name string + StartTime time.Time + Status Status + Total int + func NewTask(name string, total int) *Task + func (t *Task) Add(done int) + func (t *Task) Fail(err string) + func (t *Task) Finish() + func (t *Task) SubTask(done int) *SubTask + func (t *Task) Suspend(flag bool) + func (t *Task) Update(done int) + type Tasks []Task + func (t Tasks) Len() int + func (t Tasks) Less(i, j int) bool + func (t Tasks) Swap(i, j int)