bulkhead

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 2 Imported by: 0

README

Bulkhead

This is a package for bulkhead

Usage

Here is an example of how to use this package.

action := func() error {
       // function code to be executed
}

b := NewBulkhead(Options{}) // with default options
err := b.Execute(action)

if err != nil {
	t.Error("error should be nil")
}

These are the options you can set and their default values:

type Options struct {
	// Maximum number of concurrent requests allowed
	MaxConcurrent int64
}

const (
	DefaultMaxConcurrent = 10
)

Documentation

Index

Constants

View Source
const (
	DefaultMaxConcurrent = 10
)

Variables

View Source
var (
	ErrBulkheadFull = errors.New("bulkhead is full")
)

Functions

This section is empty.

Types

type Bulkhead

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

func NewBulkhead

func NewBulkhead(opt Options) *Bulkhead

func (*Bulkhead) Execute

func (b *Bulkhead) Execute(action func() error) error

type Options

type Options struct {
	// Maximum number of concurrent requests allowed
	MaxConcurrent int64
}

Jump to

Keyboard shortcuts

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