Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLockServiceClient ¶
func NewLockServiceClient(serverAddr string) service.LockServiceClient
Types ¶
type Lock ¶
type Lock struct { RetryMillisecondDur int // 尝试加锁的时间间隔 单位毫秒 RetryMaxTimes int // 最大加锁失败次数,超过后将强制释放锁,然后再枷锁。因为某个节点可能在加锁未释放的情况下异常退出. 如果设置为0,加不到锁就一直阻塞 Lk service.LockServiceClient }
func (*Lock) ForceLock ¶ added in v0.0.6
ForceLock
lockName 必选参数,锁的名称,可根据业务使用多种锁 clientId 必选参数,加锁的节点ID,分布式的每个节点ID必须唯一
Click to show internal directories.
Click to hide internal directories.