Documentation
¶
Index ¶
- type RandomAccessQueue
- func (r *RandomAccessQueue) Delete(hash string)
- func (r *RandomAccessQueue) Get(hash string) *serializableModels.ClientMessage
- func (r *RandomAccessQueue) Len() int
- func (r *RandomAccessQueue) PopRandom() *serializableModels.ClientMessage
- func (r *RandomAccessQueue) Put(value serializableModels.ClientMessage)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomAccessQueue ¶
type RandomAccessQueue struct {
// contains filtered or unexported fields
}
RandomAccessQueue provides a data struture that can be access randomly This helps workers clears backlogs of work more evenly If there is 20 items on 3 workers, each worker will access the next unit of work randomly
func NewRandomAccessQueue ¶
func NewRandomAccessQueue() *RandomAccessQueue
func (*RandomAccessQueue) Delete ¶
func (r *RandomAccessQueue) Delete(hash string)
Removes specified hash - synchronized
func (*RandomAccessQueue) Get ¶
func (r *RandomAccessQueue) Get(hash string) *serializableModels.ClientMessage
Gets a value from the map - synchronized
func (*RandomAccessQueue) PopRandom ¶
func (r *RandomAccessQueue) PopRandom() *serializableModels.ClientMessage
Removes and returns a random value from the map - synchronized
func (*RandomAccessQueue) Put ¶
func (r *RandomAccessQueue) Put(value serializableModels.ClientMessage)
Put value into map - synchronized
Click to show internal directories.
Click to hide internal directories.