Documentation ¶
Overview ¶
Package ytlock is high level interface for yt lock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortExclusiveLock ¶
AbortExclusiveLock cancels transaction under exclusive lock specified by the path.
There can not be more than one exclusive lock acquired for the path at the time.
In case if node has not acquired an exclusive lock nil is returned.
Types ¶
type Lock ¶
type Lock struct { Path ypath.Path Options Options Yc yt.Client // contains filtered or unexported fields }
Lock object represents cypress lock.
func NewLockOptions ¶
NewLockOptions creates Lock object with specified options.
func (*Lock) Acquire ¶
Acquire acquires cypress lock.
Returned lost channel is closed when lock is lost because of some external event, e.g. transaction being aborted remotely, network partition or coordination service downtime.
If lock is lost, there is no need to call Release explicitly.
Lock is automatically released when provided ctx is canceled.
func (*Lock) AcquireTx ¶
AcquireTx is the same as Acquire, but returns new tx that is holding the lock.