Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockGroupManager ¶
type LockManager ¶
type LockManager interface { TryObtain(ctx context.Context, key string, ttl time.Duration) (bool, error) Unlock(ctx context.Context, key string) error }
LockManager The CompareAndSwap implementation used by the LockManager should NOT block. It only locks if the key was not already locked, and returns whether it has been locked or not.
func New ¶
func New(conf supervisor.DLMConfig, connPool *supervisor.ConnPool) (LockManager, error)
type RedisLockGroup ¶
type RedisLockGroup struct {
// contains filtered or unexported fields
}
func (*RedisLockGroup) Expired ¶
func (g *RedisLockGroup) Expired(ctx context.Context) ([]string, error)
type RedisLockManager ¶
type RedisLockManager struct {
// contains filtered or unexported fields
}
func NewRedisLockManager ¶
func NewRedisLockManager(client redis.UniversalClient) *RedisLockManager
func (*RedisLockManager) Group ¶
func (m *RedisLockManager) Group(key string, ttl time.Duration) LockGroup
Click to show internal directories.
Click to hide internal directories.