Documentation ¶
Index ¶
- type RandomAccessQueue
- func (r *RandomAccessQueue) Delete(hash string)
- func (r *RandomAccessQueue) Exists(hash string) bool
- func (r *RandomAccessQueue) Get(hash string) *serializableModels.ClientRequest
- func (r *RandomAccessQueue) IndexOf(hash string) int
- func (r *RandomAccessQueue) PopRandom() *serializableModels.ClientRequest
- func (r *RandomAccessQueue) Put(value serializableModels.ClientRequest)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomAccessQueue ¶
type RandomAccessQueue struct { Hashes []serializableModels.ClientRequest // 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) Exists ¶
func (r *RandomAccessQueue) Exists(hash string) bool
See if element exists
func (*RandomAccessQueue) Get ¶
func (r *RandomAccessQueue) Get(hash string) *serializableModels.ClientRequest
Gets a value from the map - synchronized
func (*RandomAccessQueue) IndexOf ¶
func (r *RandomAccessQueue) IndexOf(hash string) int
func (*RandomAccessQueue) PopRandom ¶
func (r *RandomAccessQueue) PopRandom() *serializableModels.ClientRequest
Removes and returns a random value from the map - synchronized
func (*RandomAccessQueue) Put ¶
func (r *RandomAccessQueue) Put(value serializableModels.ClientRequest)
Put value into map - synchronized
Click to show internal directories.
Click to hide internal directories.