concurrency

package
v0.8.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicValue

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

func (*AtomicValue[T]) Get

func (a *AtomicValue[T]) Get() T

func (*AtomicValue[T]) Set

func (a *AtomicValue[T]) Set(value T)

func (*AtomicValue[T]) Update

func (a *AtomicValue[T]) Update(fn func(T) T) T

type BatchingChannel

type BatchingChannel[T any] interface {
	In() chan<- T
	Out() <-chan []T
}

func NewBatchingChannel

func NewBatchingChannel[T any](capacity int, maxBatchSize int, maxWaitTime time.Duration) BatchingChannel[T]

type BufferedConcurrentChannel

type BufferedConcurrentChannel[T any] interface {
	In() chan<- T
	Run(context.Context, func(T)) error
}

func NewBufferedConcurrentChannel

func NewBufferedConcurrentChannel[T any](capacity int, concurrency int) BufferedConcurrentChannel[T]

type KeyedLimiter

type KeyedLimiter interface {
	Allow(key string) bool
	Wait(ctx context.Context, key string) error
}

func NewKeyedLimiter

func NewKeyedLimiter(rl rate.Limit, burst int, size int, ttl time.Duration) KeyedLimiter

Jump to

Keyboard shortcuts

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