Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VolumeQueue ¶
VolumeQueue manages the exponential backoff of retrying volumes. it behaves somewhat like a priority queue. however, the key difference is that volumes which are ready to process or reprocess are read off of an unbuffered channel, meaning the order in which ready volumes are processed is at the mercy of the golang scheduler. in practice, this does not matter.
func NewVolumeQueue ¶
func NewVolumeQueue() *VolumeQueue
NewVolumeQueue returns a new VolumeQueue with the default timerSource.
func (*VolumeQueue) Enqueue ¶
func (vq *VolumeQueue) Enqueue(id string, attempt uint)
Enqueue adds an entry to the VolumeQueue with the specified retry attempt. if an entry for the specified id already exists, enqueue will remove it and create a new entry.
func (*VolumeQueue) Outstanding ¶
func (vq *VolumeQueue) Outstanding() int
Outstanding returns the number of items outstanding in this queue
func (*VolumeQueue) Stop ¶
func (vq *VolumeQueue) Stop()
Stop stops the volumeQueue and cancels all outstanding entries. stop may only be called once.
func (*VolumeQueue) Wait ¶
func (vq *VolumeQueue) Wait() (string, uint)
Wait returns the ID and attempt number of the next Volume ready to process. If no volume is ready, wait blocks until one is ready. if the volumeQueue is stopped, wait returns "", 0