Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ConsulLock ¶ added in v0.0.4
type ConsulLock struct {
// contains filtered or unexported fields
}
func (*ConsulLock) Lock ¶ added in v0.0.4
func (l *ConsulLock) Lock(ctx context.Context) (chan struct{}, error)
func (*ConsulLock) WaitForUnlock ¶ added in v0.0.4
func (l *ConsulLock) WaitForUnlock(ctx context.Context) error
type ConsulLockPool ¶ added in v0.0.4
type ConsulLockPool struct {
// contains filtered or unexported fields
}
func NewConsulLockPool ¶ added in v0.0.4
func NewConsulLockPool(consulAddress string) (ConsulLockPool, error)
func (ConsulLockPool) NewLock ¶ added in v0.0.4
func (p ConsulLockPool) NewLock(lockName string, expiry time.Duration) *ConsulLock
type CountDownLatch ¶
type CountDownLatch struct {
// contains filtered or unexported fields
}
CountDownLatch is the same as sync.WaitGroup but with the ability to wait with timeout
func NewCountDownLatch ¶
func NewCountDownLatch() *CountDownLatch
NewCountDownLatch creates a new CountDownLatch
func (*CountDownLatch) Add ¶
func (l *CountDownLatch) Add(delta int)
Add increases/decreases the countdown
func (*CountDownLatch) Close ¶
func (l *CountDownLatch) Close()
Close closes the latch unblocking wait
func (*CountDownLatch) Counter ¶
func (l *CountDownLatch) Counter() int
Counter returns the current count down number
func (*CountDownLatch) WaitWithTimeout ¶
func (l *CountDownLatch) WaitWithTimeout(timeout time.Duration) bool
WaitWithTimeout waits until the timeout runs out or until the countdown is zero
type Latch ¶
type Latch struct {
// contains filtered or unexported fields
}
Latch reusable lock that uses a channel to wait for the release of the lock
type RedisLock ¶ added in v0.0.3
type RedisLock struct {
// contains filtered or unexported fields
}
type RedisLockPool ¶ added in v0.0.4
type RedisLockPool struct {
// contains filtered or unexported fields
}
func NewRedisLockPool ¶ added in v0.0.4
func NewRedisLockPool(redisAddresses []string) (RedisLockPool, error)
Click to show internal directories.
Click to hide internal directories.