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
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(s *concurrency.Session, 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
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 RWMutex ¶
type RWMutex struct {
// contains filtered or unexported fields
}
func NewRWMutex ¶
func NewRWMutex(s *concurrency.Session, prefix string) *RWMutex