memoryclient

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryClient

func NewMemoryClient(config jobinator.ClientConfig) *jobinator.Client

NewMemoryClient returns a new jobinator client that stores all jobs in memory

Types

type MemoryClient

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

MemoryClient is the internal client of a memory backed jobinator instance

func (*MemoryClient) GetNamedJob

func (m *MemoryClient) GetNamedJob(name string) (*jobinator.Job, error)

func (*MemoryClient) IncRetryCount

func (m *MemoryClient) IncRetryCount(j *jobinator.Job) error

IncRetryCount increases the retry count of a job

func (*MemoryClient) InternalCleanup

func (m *MemoryClient) InternalCleanup(config jobinator.CleanUpConfig) error

InternalCleanup deletes all jobs that have been finished (or optionally failed jobs) older than specified in the CleanUpConfig

func (*MemoryClient) InternalEnqueueJob

func (m *MemoryClient) InternalEnqueueJob(j *jobinator.Job) error

InternalEnqueueJob queues up a job on the in memory store

func (*MemoryClient) InternalPendingJobs

func (m *MemoryClient) InternalPendingJobs() ([]*jobinator.Job, error)

InternalPendingJobs returns all pending jobs

func (*MemoryClient) InternalRegisterWorker

func (m *MemoryClient) InternalRegisterWorker(name string, wf jobinator.WorkerFunc)

InternalRegisterWorker adds the worker to the list of workers internally

func (*MemoryClient) InternalSelectJob

func (m *MemoryClient) InternalSelectJob() (*jobinator.Job, error)

InternalSelectJob selects a job and marks it as running.

func (*MemoryClient) SetError

func (m *MemoryClient) SetError(j *jobinator.Job, errtxt string, stack string) error

SetError sets the job's error status.

func (*MemoryClient) SetFinishedAt

func (m *MemoryClient) SetFinishedAt(j *jobinator.Job, t int64) error

SetFinishedAt marks the time that the job finished at

func (*MemoryClient) SetNextRun

func (m *MemoryClient) SetNextRun(j *jobinator.Job, t int64) error

SetNextRun updates the next run field of the job

func (*MemoryClient) SetStatus

func (m *MemoryClient) SetStatus(j *jobinator.Job, status int) error

SetStatus updates the job status.

Jump to

Keyboard shortcuts

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