Documentation ¶
Index ¶
- Variables
- func WaitEvents(c *clientv3.Client, key string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error)
- func WaitPrefixEvents(c *clientv3.Client, prefix string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error)
- type Barrier
- type DoubleBarrier
- type EphemeralKV
- type PriorityQueue
- type Queue
- type RWMutex
- type RemoteKV
- func GetRemoteKV(kv v3.KV, key string) (*RemoteKV, error)
- func NewKV(kv v3.KV, key, val string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewKey(kv v3.KV, key string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewSequentialKV(kv v3.KV, prefix, val string) (*RemoteKV, error)
- func NewUniqueKV(kv v3.KV, prefix string, val string, leaseID v3.LeaseID) (*RemoteKV, error)
- func NewUniqueKey(kv v3.KV, prefix string) (*RemoteKV, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Barrier ¶
type Barrier struct {
// contains filtered or unexported fields
}
Barrier creates a key in etcd to block processes, then deletes the key to release all blocked processes.
type DoubleBarrier ¶
type DoubleBarrier struct {
// contains filtered or unexported fields
}
DoubleBarrier blocks processes on Enter until an expected count enters, then blocks again on Leave until all processes have left.
func NewDoubleBarrier ¶
func NewDoubleBarrier(client *clientv3.Client, key string, count int) *DoubleBarrier
func (*DoubleBarrier) Enter ¶
func (b *DoubleBarrier) Enter() error
Enter waits for "count" processes to enter the barrier then returns
func (*DoubleBarrier) Leave ¶
func (b *DoubleBarrier) Leave() error
Leave waits for "count" processes to leave the barrier then returns
type EphemeralKV ¶
type EphemeralKV struct{ RemoteKV }
EphemeralKV is a new key associated with a session lease
func NewEphemeralKV ¶
func NewEphemeralKV(client *v3.Client, key, val string) (*EphemeralKV, error)
NewEphemeralKV creates a new key/value pair associated with a session lease
func NewUniqueEphemeralKV ¶
func NewUniqueEphemeralKV(client *v3.Client, prefix, val string) (ek *EphemeralKV, err error)
NewUniqueEphemeralKV creates a new unique key/value pair associated with a session lease
func NewUniqueEphemeralKey ¶
func NewUniqueEphemeralKey(client *v3.Client, prefix string) (*EphemeralKV, error)
NewUniqueEphemeralKey creates a new unique valueless key associated with a session lease
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a multi-reader, multi-writer distributed queue.
func NewPriorityQueue ¶
func NewPriorityQueue(client *v3.Client, key string) *PriorityQueue
NewPriorityQueue creates an etcd priority queue.
func (*PriorityQueue) Dequeue ¶
func (q *PriorityQueue) Dequeue() (string, error)
Dequeue returns Enqueue()'d items in FIFO order. If the queue is empty, Dequeue blocks until items are available.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements a multi-reader, multi-writer distributed queue.
type RemoteKV ¶
type RemoteKV struct {
// contains filtered or unexported fields
}
RemoteKV is a key/revision pair created by the client and stored on etcd
func NewSequentialKV ¶
NewSequentialKV allocates a new sequential key-value pair at <prefix>/nnnnn