task

package
v0.5.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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

type JobsScheduler struct {
	*sync.Cond
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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