retrystrategy

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MinRetryTime    = 5 * time.Second
	MaxRetryTime    = 5 * time.Minute
	JitterRetryTime = true
	RetryTimeFactor = 2
)

Right now, these are defined as constants, but the plan is to maybe make them configurable in the future

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type ModelConfigService

type ModelConfigService interface {
	// ModelConfig returns the current config for the model.
	ModelConfig(ctx context.Context) (*config.Config, error)
	// Watch returns a watcher that returns keys for any changes to model
	// config.
	Watch() (watcher.StringsWatcher, error)
}

ModelConfigService allows access to the model's configuration.

type RetryStrategy

type RetryStrategy interface {
	RetryStrategy(context.Context, params.Entities) (params.RetryStrategyResults, error)
	WatchRetryStrategy(context.Context, params.Entities) (params.NotifyWatchResults, error)
}

RetryStrategy defines the methods exported by the RetryStrategy API facade.

type RetryStrategyAPI

type RetryStrategyAPI struct {
	// contains filtered or unexported fields
}

RetryStrategyAPI implements RetryStrategy

func NewRetryStrategyAPI

func NewRetryStrategyAPI(
	authorizer facade.Authorizer,
	modelConfigService ModelConfigService,
	watcherRegistry facade.WatcherRegistry,
) (*RetryStrategyAPI, error)

func (*RetryStrategyAPI) RetryStrategy

RetryStrategy returns RetryStrategyResults that can be used by any code that uses to configure the retry timer that's currently in juju utils.

func (*RetryStrategyAPI) WatchRetryStrategy

func (h *RetryStrategyAPI) WatchRetryStrategy(ctx context.Context, args params.Entities) (params.NotifyWatchResults, error)

WatchRetryStrategy watches for changes to the model. Currently we only allow changes to the boolean that determines whether retries should be attempted or not.

Jump to

Keyboard shortcuts

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