Documentation ¶
Index ¶
- Constants
- func NewConfig(opts ...ConfigOption) *config
- func NewGenerateLoseStore(tws *TWStore) *generateLoseStore
- func NewMapStore(rp *redis.Pool, opts ...ConfigOption) *mapStore
- func NewReadyQueue(rp *redis.Pool, store role.DataStore, opts ...ConfigOption) *readyQueue
- func NewStatusStore(rp *redis.Pool, opts ...ConfigOption) *statusStore
- type ConfigOption
- type Send
- type SortedSet
- func (s *SortedSet) Add(t task.Task) error
- func (s *SortedSet) Get(uid string) task.Task
- func (s *SortedSet) Len() int
- func (s *SortedSet) MultiRemove(uids []string) error
- func (s *SortedSet) Range(st time.Duration, limit int) []task.Task
- func (s *SortedSet) Release()
- func (s *SortedSet) Remove(uid string) error
- type TWStore
- func (s TWStore) IncrRetryTimes(uid string, num int) error
- func (s TWStore) IncrSendTimes(uid string, num int) error
- func (tws *TWStore) Insert(t *model.Task) error
- func (tws *TWStore) InsertMany(ts []*model.Task) error
- func (s TWStore) NextTime(uid string, nt *time.Time) error
- func (tws *TWStore) Remove(uid string) error
- func (tws *TWStore) RemoveMany(uids []string) error
- func (tws *TWStore) Status(uid string, tt pb.TaskType) error
- func (tws *TWStore) Transaction(fn func(role.DataStore) error) (err error)
- type TWStoreTrans
- func (st *TWStoreTrans) IncrRetryTimes(uid string, num int) error
- func (st *TWStoreTrans) IncrSendTimes(uid string, num int) error
- func (st *TWStoreTrans) Insert(t *model.Task) error
- func (st *TWStoreTrans) InsertMany(ts []*model.Task) error
- func (st *TWStoreTrans) NextTime(uid string, nt *time.Time) error
- func (st *TWStoreTrans) Remove(uid string) error
- func (st *TWStoreTrans) RemoveMany(uids []string) error
- func (st *TWStoreTrans) Status(uid string, tt pb.TaskType) error
Constants ¶
View Source
const ( DefaultStorePrefix = "delay-queue" DefaultStoreName = "timing-task" )
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
func NewConfig(opts ...ConfigOption) *config
func NewGenerateLoseStore ¶
func NewGenerateLoseStore(tws *TWStore) *generateLoseStore
func NewMapStore ¶
func NewMapStore(rp *redis.Pool, opts ...ConfigOption) *mapStore
func NewReadyQueue ¶
func NewReadyQueue(rp *redis.Pool, store role.DataStore, opts ...ConfigOption) *readyQueue
func NewStatusStore ¶
func NewStatusStore(rp *redis.Pool, opts ...ConfigOption) *statusStore
Types ¶
type ConfigOption ¶
type ConfigOption func(*config)
func ConfigWithConvert ¶
func ConfigWithConvert(convert role.PbConvertTask) ConfigOption
func ConfigWithCopy ¶
func ConfigWithCopy(cp xcopy.XCopy) ConfigOption
func ConfigWithId ¶
func ConfigWithId(id string) ConfigOption
func ConfigWithName ¶
func ConfigWithName(name string) ConfigOption
func ConfigWithPrefix ¶
func ConfigWithPrefix(prefix string) ConfigOption
type SortedSet ¶
type SortedSet struct {
// contains filtered or unexported fields
}
外部注入 TASK STORE (ZSET)
func NewSortedSet ¶
func (*SortedSet) MultiRemove ¶
type TWStore ¶
type TWStore struct {
// contains filtered or unexported fields
}
为了方便重载数据单独提供一个存储
func NewTWStore ¶
func NewTWStore(rp *redis.Pool, opts ...ConfigOption) *TWStore
func (TWStore) IncrRetryTimes ¶
func (TWStore) IncrSendTimes ¶
func (*TWStore) RemoveMany ¶
type TWStoreTrans ¶
type TWStoreTrans struct { *TWStore // contains filtered or unexported fields }
func (*TWStoreTrans) IncrRetryTimes ¶
func (st *TWStoreTrans) IncrRetryTimes(uid string, num int) error
func (*TWStoreTrans) IncrSendTimes ¶
func (st *TWStoreTrans) IncrSendTimes(uid string, num int) error
func (*TWStoreTrans) InsertMany ¶
func (st *TWStoreTrans) InsertMany(ts []*model.Task) error
func (*TWStoreTrans) Remove ¶
func (st *TWStoreTrans) Remove(uid string) error
func (*TWStoreTrans) RemoveMany ¶
func (st *TWStoreTrans) RemoveMany(uids []string) error
Click to show internal directories.
Click to hide internal directories.