Documentation
¶
Index ¶
- Variables
- type BidirectionalLockExchange
- type LockExchange
- type LockerOption
- type MutexLock
- type RedSyncMutex
- type RedisLockExchange
- func (e *RedisLockExchange) Listen(ctx context.Context, id string, callback func())
- func (e *RedisLockExchange) Release(ctx context.Context, id string) error
- func (e *RedisLockExchange) ReleaseChannel(ctx context.Context, id string) <-chan *redis.Message
- func (e *RedisLockExchange) Request(ctx context.Context, id string) error
- type RedisLocker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LockExchangeChannel = "tusd_lock_release_request_%s" LockReleaseChannel = "tusd_lock_released_%s" LockExpiry = 8 * time.Second )
Functions ¶
This section is empty.
Types ¶
type LockExchange ¶
type LockerOption ¶
type LockerOption func(l *RedisLocker)
func WithLogger ¶
func WithLogger(logger *slog.Logger) LockerOption
func WithMutexCreator ¶
func WithMutexCreator(uri string) (LockerOption, error)
type RedSyncMutex ¶
type RedSyncMutex struct {
// contains filtered or unexported fields
}
func (*RedSyncMutex) CreateMutex ¶
func (rsm *RedSyncMutex) CreateMutex(id string) MutexLock
type RedisLockExchange ¶
type RedisLockExchange struct {
// contains filtered or unexported fields
}
func (*RedisLockExchange) Listen ¶
func (e *RedisLockExchange) Listen(ctx context.Context, id string, callback func())
func (*RedisLockExchange) Release ¶
func (e *RedisLockExchange) Release(ctx context.Context, id string) error
func (*RedisLockExchange) ReleaseChannel ¶
func (e *RedisLockExchange) ReleaseChannel(ctx context.Context, id string) <-chan *redis.Message
type RedisLocker ¶
type RedisLocker struct { //rs *redsync.Redsync CreateMutex func(id string) MutexLock // contains filtered or unexported fields }
func New ¶
func New(uri string, lockerOptions ...LockerOption) (*RedisLocker, error)
func (*RedisLocker) Health ¶
func (locker *RedisLocker) Health(_ context.Context) models.ServiceHealthResp
func (*RedisLocker) UseIn ¶
func (locker *RedisLocker) UseIn(composer *handler.StoreComposer)
Click to show internal directories.
Click to hide internal directories.