jobs

package
v0.0.0-...-13330ff Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2015 License: BSD-2-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const JobStatusDone = "Done"
View Source
const JobStatusStarted = "Started"
View Source
const JobTypeParser = "Parser"
View Source
const JobTypeScraper = "Scraper"

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	StartTime, EndTime        int64
	JobId, JobType, JobStatus string
	Params                    map[string]string
}

type JobManager

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

Keeps track of running jobs in memory. No need to persist since jobs will only run in the single go process for now.

func GetJobManager

func GetJobManager() *JobManager

func (*JobManager) AddJob

func (jm *JobManager) AddJob(jobType string, params map[string]string) string

func (*JobManager) ExecuteJob

func (jm *JobManager) ExecuteJob(jobFunc func(params map[string]string), job *Job)

func (*JobManager) GetJobs

func (jm *JobManager) GetJobs() map[string]*Job

func (*JobManager) JobComplete

func (jm *JobManager) JobComplete(jobId string)

func (*JobManager) StartJob

func (jm *JobManager) StartJob(jobFunc func(params map[string]string), jobType string, params map[string]string) string

Jump to

Keyboard shortcuts

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