Documentation ¶
Index ¶
- type Job
- func (job *Job) GetWaitTime(time int64, planned map[int]bool) int64
- func (job *Job) IsBehind(time int64) bool
- func (job *Job) Less(other *Job) bool
- func (job *Job) Run(time int64, profile bool)
- func (job *Job) SetFrequency(frequency int64)
- func (job *Job) UpdateWaitTime(time int64, planned map[int]bool)
- type JobDependency
- type JobGroup
- type JobLogic
- type JobRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { // The unique ID of this job ID int // The name of this job Name string // The group of this job which dictates ordering Group uint8 // The cost of this job Cost int // If this job should be executed asynchronously Async bool // If this job should only be executed after a job with this ID is After int // If the job should stricly follow the wait times. So if the wait time is 20 then the job will try to run 50 times a second exactly. Strict bool // The minimum milliseconds we should wait between execution MinWait int64 // The maximum milliseconds we should wait between execution MaxWait int64 // The last computed wait time WaitTime int64 // The last time this job ran LastRun int64 // The last duration between the last run and the previous run LastDuration int64 // If the job should be profiled Profile bool // The last profile start in nanos ProfileStart int64 // The last profile end in nanos ProfileEnd int64 // The logic which executes the job Logic JobLogic }
func (*Job) SetFrequency ¶
type JobDependency ¶
type JobRunner ¶
type JobRunner struct { Groups []JobGroup Ready ds.SortableList[*Job] Planned map[int]bool Dependency map[int]bool // How much we can afford to run Budget int TotalCost int Profile bool LastDuration int64 LastRun int64 ProfileStart int64 ProfileEnd int64 }
func (*JobRunner) UnreadyDependency ¶
func (*JobRunner) UnreadyLast ¶
func (r *JobRunner) UnreadyLast()
Click to show internal directories.
Click to hide internal directories.