grmux

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2025 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func() error

type RedisMutex

type RedisMutex interface {
	Lock(ctx context.Context, key string, uniqueValue int) error
	Unlock(ctx context.Context, key string, uniqueValue int) error
	Safely(ctx context.Context, key string, handler HandlerFunc) error
}

func NewRedisMux

func NewRedisMux(ctx context.Context, client gdb.RedisClient, opt *RedisMuxOption, logger *zap.Logger, tracer opentracing.Tracer) (RedisMutex,
	error)

type RedisMuxOption

type RedisMuxOption struct {
	Expiration          time.Duration
	RetryTimes          int
	SleepTimeExpandStep time.Duration
	SleepTimeFloat      time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL