Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerIDLocker ¶
type PeerIDLocker struct {
// contains filtered or unexported fields
}
PeerIDLocker is used to handle mutex lock/unlock on a per-peerID basis for systems that may need concurrent access to peerID specific resources such as IPNS record publishing
The only time this blocks is when creating the initial lock, afterwards all writes for a record are non-blocking unless another record is first published at the same time.
func (*PeerIDLocker) Create ¶
func (pl *PeerIDLocker) Create(pid peer.ID)
Create is like exists, except it populates the map if the entry does not exist
func (*PeerIDLocker) Exists ¶
func (pl *PeerIDLocker) Exists(pid peer.ID) bool
Exists check if we have a lock for this peerID
func (*PeerIDLocker) Lock ¶
func (pl *PeerIDLocker) Lock(pid peer.ID)
Lock obtains a lock for the peerID
func (*PeerIDLocker) Unlock ¶
func (pl *PeerIDLocker) Unlock(pid peer.ID)
Unlock reverts the peerID lock
Click to show internal directories.
Click to hide internal directories.