Documentation ¶
Index ¶
- type JobsAllocator
- type JobsScheduler
- type 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 Status
- type SubTask
- type Task
- type Tasks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobsAllocator ¶ added in v0.4.6
type JobsAllocator struct {
// contains filtered or unexported fields
}
func NewConstantJobsAllocator ¶ added in v0.4.6
func NewConstantJobsAllocator(num int) *JobsAllocator
func (*JobsAllocator) AvailableJobs ¶ added in v0.4.6
func (allocator *JobsAllocator) AvailableJobs(tracker *Task) int
func (*JobsAllocator) Init ¶ added in v0.4.6
func (allocator *JobsAllocator) Init()
Init jobs allocation. This method is used to request allocation of jobs for the first time.
func (*JobsAllocator) MaxJobs ¶ added in v0.4.6
func (allocator *JobsAllocator) MaxJobs() int
type JobsScheduler ¶ added in v0.4.6
JobsScheduler allocates jobs to multiple tasks.
func NewJobsScheduler ¶ added in v0.4.6
func NewJobsScheduler(num int) *JobsScheduler
NewJobsScheduler creates a JobsScheduler with num jobs.
func (*JobsScheduler) GetJobsAllocator ¶ added in v0.4.6
func (s *JobsScheduler) GetJobsAllocator(taskName string) *JobsAllocator
func (*JobsScheduler) Register ¶ added in v0.4.6
func (s *JobsScheduler) Register(taskName string, priority int, privileged bool) bool
Register a task in the JobsScheduler. Registered tasks will be ignored and return false.
func (*JobsScheduler) Unregister ¶ added in v0.4.6
func (s *JobsScheduler) Unregister(taskName string)
Unregister a task from the JobsScheduler.
type Monitor ¶
Monitor monitors the progress of all tasks.
func NewTaskMonitor ¶
func NewTaskMonitor() *Monitor
NewTaskMonitor creates a Monitor and add pending tasks.
Click to show internal directories.
Click to hide internal directories.