Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Lock ¶
type Lock interface {
Unlock() error
}
type LockProvider ¶
type LockProvider interface { Lock(Configuration) (Lock, error) TryLock(Configuration) (Lock, error) }
type Options ¶
type Options interface {
Apply(opt *Configuration)
}
domain interfaces
func WithLockAtMost ¶
WithLockAtMost specifies the maximum holding time of the lock. If atMost added by now arrives and the task has not finished, the lock would be release by force. If atMost is not positive, the lock will be always held until it's released explicitly.
func WithLockTimeout ¶
WithLockTimeout specifies the maximum waiting time when required lock is held by others. If timeout added by now arrives and the lock is still unavailable, LockTask would stop waiting and an error would be returned. Timeout is useless for TryLockTask method.
func WithProvider ¶
func WithProvider(provider LockProvider) Options
Click to show internal directories.
Click to hide internal directories.