Documentation ¶
Index ¶
- Constants
- type RedisQueue
- func (hq *RedisQueue) CheckWorkCompleted(key string, id interface{}) bool
- func (hq *RedisQueue) CheckWorkCompletedInBulk(key string, id []int64) ([]bool, error)
- func (hq *RedisQueue) CheckWorkExpired(key string, id interface{}) bool
- func (hq *RedisQueue) CheckWorkExpiredInBulk(key string, id []int64) ([]bool, error)
- func (hq *RedisQueue) GetCache(key string, id int32) (string, error)
- func (hq *RedisQueue) GetCacheInBulk(key string, id []int32) ([]string, error)
- func (hq *RedisQueue) GetWork() (*Work, error)
- func (hq *RedisQueue) QueueWork(work []Work, priority int) error
- func (hq *RedisQueue) ScaledSize() (int, error)
- func (hq *RedisQueue) SetCache(key string, id int32, value string) error
- func (hq *RedisQueue) SetCacheInBulk(key string, ids []int32, strings []string) error
- func (hq *RedisQueue) SetWorkCompleted(key string, id interface{}) error
- func (hq *RedisQueue) SetWorkCompletedInBulk(key string, ids []int64) error
- func (hq *RedisQueue) SetWorkExpire(key string, id interface{}, seconds int) error
- func (hq *RedisQueue) Size() (int, error)
- type Work
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisQueue ¶
type RedisQueue struct {
// contains filtered or unexported fields
}
RedisQueue operation queue to CCP APIs
func NewRedisQueue ¶
func NewRedisQueue(r *redis.Pool, key string) *RedisQueue
NewRedisQueue creates a new work queue with an existing redigo pool and key name.
func (*RedisQueue) CheckWorkCompleted ¶
func (hq *RedisQueue) CheckWorkCompleted(key string, id interface{}) bool
CheckWorkCompleted takes a key and checks if the ID has been completed to prevent duplicates
func (*RedisQueue) CheckWorkCompletedInBulk ¶
func (hq *RedisQueue) CheckWorkCompletedInBulk(key string, id []int64) ([]bool, error)
CheckWorkCompletedInBulk takes a key and checks if the list of IDs has completed
func (*RedisQueue) CheckWorkExpired ¶
func (hq *RedisQueue) CheckWorkExpired(key string, id interface{}) bool
CheckWorkExpired takes a key and checks if the ID has expired
func (*RedisQueue) CheckWorkExpiredInBulk ¶
func (hq *RedisQueue) CheckWorkExpiredInBulk(key string, id []int64) ([]bool, error)
CheckWorkExpiredInBulk takes a key and checks if the list of IDs has expired
func (*RedisQueue) GetCache ¶
func (hq *RedisQueue) GetCache(key string, id int32) (string, error)
GetCache takes a key and gets the string for the ID
func (*RedisQueue) GetCacheInBulk ¶
func (hq *RedisQueue) GetCacheInBulk(key string, id []int32) ([]string, error)
GetCacheInBulk takes a key and checks if the list of IDs has expired
func (*RedisQueue) GetWork ¶
func (hq *RedisQueue) GetWork() (*Work, error)
GetWork retreives items from the queue
func (*RedisQueue) QueueWork ¶
func (hq *RedisQueue) QueueWork(work []Work, priority int) error
QueueWork adds work to the queue
func (*RedisQueue) ScaledSize ¶
func (hq *RedisQueue) ScaledSize() (int, error)
ScaledSize returns number of elements in the queue scaled by priority
func (*RedisQueue) SetCache ¶
func (hq *RedisQueue) SetCache(key string, id int32, value string) error
SetCache takes a key and sets the string for the ID
func (*RedisQueue) SetCacheInBulk ¶
func (hq *RedisQueue) SetCacheInBulk(key string, ids []int32, strings []string) error
SetCacheInBulk takes keys and sets the strings for the ID
func (*RedisQueue) SetWorkCompleted ¶
func (hq *RedisQueue) SetWorkCompleted(key string, id interface{}) error
SetWorkCompleted takes a key and sets if the ID has been completed to prevent duplicates
func (*RedisQueue) SetWorkCompletedInBulk ¶
func (hq *RedisQueue) SetWorkCompletedInBulk(key string, ids []int64) error
SetWorkCompleted takes a key and sets if the ID has been completed to prevent duplicates
func (*RedisQueue) SetWorkExpire ¶
func (hq *RedisQueue) SetWorkExpire(key string, id interface{}, seconds int) error
SetWorkExpire takes a key and sets if the ID has failed to prevent multiple failed
func (*RedisQueue) Size ¶
func (hq *RedisQueue) Size() (int, error)
Size returns number of elements in the queue