Documentation ¶
Index ¶
- func NewMemoryClient(config jobinator.ClientConfig) *jobinator.Client
- type MemoryClient
- func (m *MemoryClient) GetNamedJob(name string) (*jobinator.Job, error)
- func (m *MemoryClient) IncRetryCount(j *jobinator.Job) error
- func (m *MemoryClient) InternalCleanup(config jobinator.CleanUpConfig) error
- func (m *MemoryClient) InternalEnqueueJob(j *jobinator.Job) error
- func (m *MemoryClient) InternalPendingJobs() ([]*jobinator.Job, error)
- func (m *MemoryClient) InternalRegisterWorker(name string, wf jobinator.WorkerFunc)
- func (m *MemoryClient) InternalSelectJob() (*jobinator.Job, error)
- func (m *MemoryClient) SetError(j *jobinator.Job, errtxt string, stack string) error
- func (m *MemoryClient) SetFinishedAt(j *jobinator.Job, t int64) error
- func (m *MemoryClient) SetNextRun(j *jobinator.Job, t int64) error
- func (m *MemoryClient) SetStatus(j *jobinator.Job, status int) error
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) 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