examplecrasher

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "example-crasher"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleCrasher

type ExampleCrasher struct{}

ExampleCrasher demonstrates retry and failure behavior. It crashes after 5 seconds, retries up to 2 times, and is NOT an allowed failure - so it takes down the whole service manager when retries are exhausted.

func New

func New() (*ExampleCrasher, error)

func (*ExampleCrasher) MaxRetries

func (c *ExampleCrasher) MaxRetries() int

MaxRetries makes ExampleCrasher implement the Retryable interface. The service manager will restart it up to 2 times before giving up.

func (*ExampleCrasher) Name

func (c *ExampleCrasher) Name() string

func (*ExampleCrasher) RetryDelay

func (c *ExampleCrasher) RetryDelay() time.Duration

func (*ExampleCrasher) Run

func (c *ExampleCrasher) Run(
	ctx context.Context,
) error

func (*ExampleCrasher) Stop

func (c *ExampleCrasher) Stop(
	_ context.Context,
) error

Jump to

Keyboard shortcuts

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