Documentation ¶
Index ¶
- type Job
- type SqlService
- func (m *SqlService) BulkNew(newJobs []*job_dispatcher.Job) (err error)
- func (m *SqlService) Clean() (err error)
- func (m *SqlService) Complete(job *job_dispatcher.Job) (err error)
- func (m *SqlService) GetCurrentJobOfWorker(workerInstances []string, currentWorkerUID uuid.UUID) (job *job_dispatcher.Job, found bool, err error)
- func (m *SqlService) GetJobByUUID(uid uuid.UUID) (job *job_dispatcher.Job, err error)
- func (m *SqlService) GetLatestJob(workerInstances []string, currentWorkerUID uuid.UUID) (job *job_dispatcher.Job, err error)
- func (m *SqlService) GetStats() (results []job_dispatcher.Stats, err error)
- func (m *SqlService) HeartBeat(job *job_dispatcher.Job, status map[string]interface{}) (err error)
- func (m *SqlService) New(job *job_dispatcher.Job) (err error)
- func (m *SqlService) Release(job *job_dispatcher.Job) (err error)
- func (m *SqlService) Start(job *job_dispatcher.Job) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { job_dispatcher.Job DeletedAt gorm.DeletedAt `json:"deletedAt"` ParametersJSON datatypes.JSON `json:"-" gorm:"type:jsonb;"` // json TasksJSON datatypes.JSON `json:"-" gorm:"type:jsonb;"` // json CurrentStatusJSON datatypes.JSON `json:"-" gorm:"type:jsonb;"` // json }
Job extends the model so that it works with sql
type SqlService ¶
type SqlService struct{}
func (*SqlService) BulkNew ¶
func (m *SqlService) BulkNew(newJobs []*job_dispatcher.Job) (err error)
BulkNew creates multiple new jobs
func (*SqlService) Complete ¶
func (m *SqlService) Complete(job *job_dispatcher.Job) (err error)
Complete marks the job as completed
func (*SqlService) GetCurrentJobOfWorker ¶
func (m *SqlService) GetCurrentJobOfWorker( workerInstances []string, currentWorkerUID uuid.UUID, ) (job *job_dispatcher.Job, found bool, err error)
GetCurrentJobOfWorker retrieves the job of the worker if one exists in the database
func (*SqlService) GetJobByUUID ¶
func (m *SqlService) GetJobByUUID(uid uuid.UUID) (job *job_dispatcher.Job, err error)
GetJobByUUID returns a job by its unique identifier
func (*SqlService) GetLatestJob ¶
func (m *SqlService) GetLatestJob(workerInstances []string, currentWorkerUID uuid.UUID) (job *job_dispatcher.Job, err error)
GetLatestJob returns the latest job
func (*SqlService) GetStats ¶
func (m *SqlService) GetStats() (results []job_dispatcher.Stats, err error)
GetStats returns the statistics of each job instance
func (*SqlService) HeartBeat ¶
func (m *SqlService) HeartBeat(job *job_dispatcher.Job, status map[string]interface{}) (err error)
HeartBeat marks a job as alive
func (*SqlService) New ¶
func (m *SqlService) New(job *job_dispatcher.Job) (err error)
func (*SqlService) Release ¶
func (m *SqlService) Release(job *job_dispatcher.Job) (err error)
Release releases the job
func (*SqlService) Start ¶
func (m *SqlService) Start(job *job_dispatcher.Job) (err error)
Start marks a job as started
Click to show internal directories.
Click to hide internal directories.