Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributedMutex ¶
type DistributedMutex interface {
TryRunWithMutex(key string, timeout time.Duration, fn func()) error
}
DistributedMutex -
func NewRedisDistributedMutex ¶ added in v0.1.4
func NewRedisDistributedMutex(redisOper ndb.RedisOper, lockTimeout time.Duration) DistributedMutex
NewRedisDistributedMutex - This is just an example, and it is recommended to use ETCD for distributed lock. In addition, This pattern is discouraged in favor of the Redlock(https://redis.io/topics/distlock) algorithm which is only a bit more complex to implement, but offers better guarantees and is fault tolerant.
type Server ¶
type Server interface { graceful.ShutdownServer }
Server -
func MustNewServer ¶
func MustNewServer(config *nconf.Config, opt ...ServerOption) Server
MustNewServer -
type ServerOption ¶
type ServerOption func(*serverOptions)
ServerOption -
func DistributedMutexOption ¶ added in v0.2.1
func DistributedMutexOption(distributedMutex DistributedMutex) ServerOption
DistributedMutexOption -
func FuncJobsOption ¶ added in v0.2.2
func FuncJobsOption(funcJobs FuncJobs) ServerOption
FuncJobsOption -
Click to show internal directories.
Click to hide internal directories.