taskhelp

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceIfFound

func SliceIfFound[T any](slice []T, f func(T) bool) ([]T, bool)

SubsetIf returns a subset of the slice for which the predicate is true. It does not allocate memory, but rearranges the list in place. A non-zero list input will always return a non-zero list. The return value is the subset and a boolean indicating whether the subset was sliced.

Types

type MaxCounter added in v1.23.1

type MaxCounter struct {
	// maximum number of tasks of this type that can be run
	N int
	// contains filtered or unexported fields
}

func Max added in v1.23.1

func Max(n int) *MaxCounter

func (*MaxCounter) Active added in v1.23.1

func (m *MaxCounter) Active() int

note: cur can't be called on counters for which max is 0

func (*MaxCounter) ActiveThis added in v1.23.1

func (m *MaxCounter) ActiveThis() int

func (*MaxCounter) Add added in v1.23.1

func (m *MaxCounter) Add(n int)

func (*MaxCounter) AtMax added in v1.23.1

func (m *MaxCounter) AtMax() bool

func (*MaxCounter) Max added in v1.23.1

func (m *MaxCounter) Max() int

Jump to

Keyboard shortcuts

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