Documentation
¶
Index ¶
- Variables
- type BoundedQueue
- type Client
- type Lock
- func (rl *Lock) Acquire() (bool, error)
- func (rl *Lock) AcquireCtx(ctx context.Context) (bool, error)
- func (rl *Lock) AcquireWait() error
- func (rl *Lock) AcquireWaitCtx(ctx context.Context) error
- func (rl *Lock) Release() (bool, error)
- func (rl *Lock) ReleaseCtx(ctx context.Context) (bool, error)
- func (rl *Lock) SetExpire(seconds int)
- type Queue
- type Redis
- type Set
- type UniqueQueue
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxRetry = maxRetry
Functions ¶
This section is empty.
Types ¶
type BoundedQueue ¶
func NewBoundedQueue ¶
func NewBoundedQueue(rc Client, key string, cap uint64) BoundedQueue
func NewBoundedUniqueQueue ¶
func NewBoundedUniqueQueue(rc Client, key string, cap uint64) BoundedQueue
type Client ¶
type Client interface {
redis.UniversalClient
}
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
A Lock is a redis lock.
func (*Lock) AcquireCtx ¶
AcquireCtx acquires the lock with the given ctx.
func (*Lock) AcquireWait ¶
func (*Lock) ReleaseCtx ¶
ReleaseCtx releases the lock with the given ctx.
type Queue ¶
type Queue interface {
Push(v ...any) error
Pop() (string, error)
PopN(n int) ([]string, error)
BPop() (string, error)
Len() uint64
}
func NewUniqueQueue ¶
type Set ¶
type UniqueQueue ¶
type UniqueQueue struct {
// contains filtered or unexported fields
}
func NewExportUniqueQueue ¶
func NewExportUniqueQueue(rc Client, key string) UniqueQueue
Click to show internal directories.
Click to hide internal directories.