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
Click to show internal directories.
Click to hide internal directories.