Documentation ¶
Index ¶
- Variables
- func AcquireLock(conn redis.Conn, lockerKey string, lockerID string, expireTime int64) error
- func HmGet(conn redis.Conn, key string, fields ...interface{}) ([]interface{}, error)
- func HmSet(conn redis.Conn, key string, fieldAndValues ...interface{}) error
- func KeyInProgressQueue(namespace string, jobType string, workerPoolID string) string
- func KeyJobLock(namespace string, jobType string) string
- func KeyJobLockInfo(namespace string, jobType string) string
- func KeyJobStats(namespace string, jobID string) string
- func KeyJobTrackInProgress(namespace string) string
- func KeyJobs(namespace, jobType string) string
- func KeyNamespacePrefix(namespace string) string
- func KeyPeriod(namespace string) string
- func KeyPeriodicLock(namespace string) string
- func KeyPeriodicPolicy(namespace string) string
- func KeyStatusUpdateRetryQueue(namespace string) string
- func KeyUpstreamJobAndExecutions(namespace, upstreamJobID string) string
- func KeyWorkerPools(namespace string) string
- func RedisKeyLastPeriodicEnqueue(namespace string) string
- func RedisKeyScheduled(namespace string) string
- func RedisLuaReenqueueScript(jobTypesCount int) *redis.Script
- func RedisNamespacePrefix(namespace string) string
- func ReleaseLock(conn redis.Conn, lockerKey string, lockerID string) error
- type JobScore
Constants ¶
This section is empty.
Variables ¶
var ErrNoElements = errors.New("no elements got from the backend")
ErrNoElements is a pre defined error to describe the case that no elements got from the backend database.
var HookAckScript = redis.NewScript(2, hookAckScriptText)
HookAckScript is defined to set the hook event ACK in the job stats map
var SetStatusScript = redis.NewScript(2, setStatusScriptText)
SetStatusScript is lua script for setting job status atomically
var StatusResetScript = redis.NewScript(2, statusResetScriptText)
StatusResetScript is lua script to reset the job stats
Functions ¶
func AcquireLock ¶
AcquireLock acquires a redis lock with specified expired time
func KeyInProgressQueue ¶
KeyInProgressQueue returns the key of the in progress queue for the specified job type.
func KeyJobLock ¶
KeyJobLock returns the key of lock for the specified job type.
func KeyJobLockInfo ¶
KeyJobLockInfo returns the key of lock_info for the specified job type.
func KeyJobStats ¶
KeyJobStats returns the key of job stats
func KeyJobTrackInProgress ¶
KeyJobTrackInProgress returns the key of in progress jobs tracking queue
func KeyNamespacePrefix ¶
KeyNamespacePrefix returns the based key based on the namespace.
func KeyPeriodicLock ¶
KeyPeriodicLock returns the key of locker under period
func KeyPeriodicPolicy ¶
KeyPeriodicPolicy returns the key of periodic policies.
func KeyStatusUpdateRetryQueue ¶
KeyStatusUpdateRetryQueue returns the key of status change retrying queue
func KeyUpstreamJobAndExecutions ¶
KeyUpstreamJobAndExecutions returns the key for persisting executions.
func KeyWorkerPools ¶
KeyWorkerPools returns the key of the worker pool
func RedisKeyLastPeriodicEnqueue ¶
RedisKeyLastPeriodicEnqueue returns key of timestamp if last periodic enqueue.
func RedisKeyScheduled ¶
RedisKeyScheduled returns key of scheduled job.
func RedisLuaReenqueueScript ¶
RedisLuaReenqueueScript returns redis script of redisLuaReenqueueJob
func RedisNamespacePrefix ¶
RedisNamespacePrefix ... Same with 'KeyNamespacePrefix', only for compatibility.