models

package
v0.0.0-...-2a2c8f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

Gets a value from the map - synchronized

func (*RandomAccessQueue) IndexOf

func (r *RandomAccessQueue) IndexOf(hash string) int

func (*RandomAccessQueue) PopRandom

Removes and returns a random value from the map - synchronized

func (*RandomAccessQueue) Put

Put value into map - synchronized

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL