circuit

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breaker

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

Breaker is an object that will allow conncurrent checks if the breaker is safe to use. This object works very much like a real world electrical breaker.

func (*Breaker) Close

func (b *Breaker) Close()

Close closes the breaker thus making it safe

func (*Breaker) Open

func (b *Breaker) Open()

Open opens the breaker thus making is unsafe

func (*Breaker) Safe

func (b *Breaker) Safe() bool

Safe checks wheather the breaker is open or not

type Ready added in v0.6.1

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

Ready is a object that will mark once a entity is ready

func (*Ready) Mark added in v0.6.1

func (r *Ready) Mark()

Mark mark the instance as ready

func (*Ready) On added in v0.6.1

func (r *Ready) On() <-chan struct{}

On returns a channel that get's closed once the instance is marked as ready

type Retry added in v0.7.0

type Retry struct {
	Amount  int8 `json:"amount"`
	Retries int8
}

Retry allowes a given method to be retried x amount of times.

func (*Retry) Attempt added in v0.7.0

func (retry *Retry) Attempt(method func() error) error

Attempt tries to attempt the given method for the given amount of retries. If the method still fails after the set limit is a error returned.

Jump to

Keyboard shortcuts

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