models

package
v0.0.0-...-b370a20 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 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 {
	// 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

Gets a value from the map - synchronized

func (*RandomAccessQueue) Len

func (r *RandomAccessQueue) Len() int

Get length - synchronized

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
JackTT - Gopher 🇻🇳