store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	GetLock(name string) lock.Locker

	CreateJob(j *job.Job) error
	ReplaceJob(j *job.Job) error
	LoadJob(j *job.Job) error
	DeleteJob(j *job.Job) (bool, error)

	CreateJobInBucket(bucket string, j *job.Job, isTTR bool) error
	GetReadyJobsInBucket(bucket string, num uint) ([]job.NameVersion, error)
	CollectInFlightJobNumberBucket(bucket string) (uint64, error)

	PushJobToQueue(queuePrefix, queueName string, j *job.Job) error
	PopJobFromQueue(queue string) (job.NameVersion, error)
	BPopJobFromQueue(queue string, blockTime time.Duration) (job.NameVersion, error)
	CollectInFlightJobNumberQueue(queuePrefix string) (map[string]uint64, error)
}

Store is a common storage interface, which is for manage jobs pool, buckets, and queue. Right now it is based on redis implementation, it might be change to other storage like memory or mysql, etc...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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