Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobsAllocator ¶
type JobsAllocator struct {
// contains filtered or unexported fields
}
func NewConstantJobsAllocator ¶
func NewConstantJobsAllocator(num int) *JobsAllocator
func (*JobsAllocator) AvailableJobs ¶
func (allocator *JobsAllocator) AvailableJobs() int
func (*JobsAllocator) Init ¶
func (allocator *JobsAllocator) Init()
Init jobs allocation. This method is used to request allocation of jobs for the first time.
func (*JobsAllocator) MaxJobs ¶
func (allocator *JobsAllocator) MaxJobs() int
type JobsScheduler ¶
JobsScheduler allocates jobs to multiple tasks.
func NewJobsScheduler ¶
func NewJobsScheduler(num int) *JobsScheduler
NewJobsScheduler creates a JobsScheduler with num jobs.
func (*JobsScheduler) GetJobsAllocator ¶
func (s *JobsScheduler) GetJobsAllocator(taskName string) *JobsAllocator
func (*JobsScheduler) Register ¶
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 ¶
func (s *JobsScheduler) Unregister(taskName string)
Unregister a task from the JobsScheduler.
Click to show internal directories.
Click to hide internal directories.