roundrobin

package module
v0.0.0-...-2006c02 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 2 Imported by: 0

README

roundrobin

a simple thread-safe implementation of round-robin algorithm.

License

MIT license

Copyright (c) 2022 Mohammad Hadi Hosseinpour

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoundRobin

type RoundRobin[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](equalityTestFunc func(T, T) bool) *RoundRobin[T]

func (*RoundRobin[T]) Add

func (r *RoundRobin[T]) Add(item T)

func (*RoundRobin[T]) Clear

func (r *RoundRobin[T]) Clear()

func (*RoundRobin[T]) Elements

func (r *RoundRobin[T]) Elements() []T

func (*RoundRobin[T]) Len

func (r *RoundRobin[T]) Len() int

func (*RoundRobin[T]) Next

func (r *RoundRobin[T]) Next() T

func (*RoundRobin[T]) TryRemove

func (r *RoundRobin[T]) TryRemove(item T) bool

Jump to

Keyboard shortcuts

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