jobs

package
v0.0.0-...-7a76d2e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 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 Job

type Job struct {
	// contains filtered or unexported fields
}

Job represents a job

type JobManager

type JobManager struct {
	// contains filtered or unexported fields
}

JobManager manages the jobs

func NewJobManager

func NewJobManager() *JobManager

NewJobManager creates a new job manager

func (*JobManager) AddJob

func (jm *JobManager) AddJob(jobID string, monster models.Monster, store *store.Store)

AddJob adds a new job to the job manager

func (*JobManager) CommitJobDataToStore

func (jm *JobManager) CommitJobDataToStore(jobID string) int

CommitJobDataToStore commits the job data to the store and returns the asset ID

func (*JobManager) GetJobs

func (jm *JobManager) GetJobs() []models.Job

GetJobs returns the list of jobs

func (*JobManager) StartWorkerPool

func (jm *JobManager) StartWorkerPool(workerCount int)

func (*JobManager) StopWorkerPool

func (jm *JobManager) StopWorkerPool()

func (*JobManager) UpdateJobState

func (jm *JobManager) UpdateJobState(jobID string, newState JobState, id int)

UpdateJobState updates the state of the job

type JobState

type JobState string
const (
	JobStatePending  JobState = "Pending"
	JobStateRunning  JobState = "Running"
	JobStateComplete JobState = "Complete"
)

Jump to

Keyboard shortcuts

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