resiliency

package
v1.2.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTaskHandler

func NewTaskHandler(telCtx domain.TelemetryContext, spec *model.TaskSpec, adapter secondary.SecodaryPort) domain.TaskHandler

Types

type CallWithContextAlias

type CallWithContextAlias = func(context.Context, *TaskContext) secondary.SecondaryPortCallResult

func WithAdaptiveRTOCallTimeout added in v1.0.23

func WithAdaptiveRTOCallTimeout(spec model.AdaptiveTimeoutSpec, secondaryAdapter secondary.SecodaryPort, telCtx domain.TelemetryContext, next CallWithContextAlias) CallWithContextAlias

func WithCallDurationMetrics

func WithCallDurationMetrics(next CallWithContextAlias, async bool) CallWithContextAlias

func WithCallTimeout

func WithCallTimeout(timeout time.Duration, next CallWithContextAlias) CallWithContextAlias

func WithCriticalError

func WithCriticalError(isCritical bool, next CallWithContextAlias) CallWithContextAlias

func WithLogger

func WithLogger(telCtx domain.TelemetryContext, timing string, secondaryAdapter secondary.SecodaryPort, next CallWithContextAlias) CallWithContextAlias

func WithTaskDurationMetrics

func WithTaskDurationMetrics(next CallWithContextAlias, async bool) CallWithContextAlias

func WithTaskTimeout

func WithTaskTimeout(timeout time.Duration, next CallWithContextAlias) CallWithContextAlias

func WithUnWrapTaskContext

func WithUnWrapTaskContext(next CallAlias) CallWithContextAlias

WithUnWrapTaskContext decorates `next` function with a decorator that unwraps TaskContext into context.Context Should be the first decorator

type CircuitBreaker

type CircuitBreaker = *gobreaker.CircuitBreaker[secondary.SecondaryPortCallResult]

type TaskContext

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

func (*TaskContext) IncAttempt

func (tc *TaskContext) IncAttempt()

Jump to

Keyboard shortcuts

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