srate

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShardMaxConcurrencyKey

func ShardMaxConcurrencyKey(shardID int, maxConcurrency int) int

Types

type Config

type Config struct {
	Logger         log.Logger
	MaxConcurrency int
	StartupDelay   int
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Apply

func (c *Config) Apply(opts []ConfigOpt)

type ConfigOpt

type ConfigOpt func(config *Config)

func WithLogger

func WithLogger(logger log.Logger) ConfigOpt

func WithMaxConcurrency

func WithMaxConcurrency(maxConcurrency int) ConfigOpt

func WithStartupDelay

func WithStartupDelay(startupDelay int) ConfigOpt

type Limiter

type Limiter interface {
	Logger() log.Logger
	Close(ctx context.Context)

	WaitBucket(ctx context.Context, shardID int) error
	UnlockBucket(shardID int)
}

func NewLimiter

func NewLimiter(opts ...ConfigOpt) Limiter

Jump to

Keyboard shortcuts

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