async

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConsumerCfgDefined = errors.New("no amqp consumer defined")
View Source
var ErrTooManyRetries = errors.New("too many retries")

Functions

func New

func New(ctx context.Context, cfg Subscriber, opts Options) error

New instantiates and executes an async agent consuming from a rabbitmq service. The caller is responsible for reconnections.

func StartAgent

func StartAgent(ctx context.Context, opts async.Options) bool

Types

type Options

type Options struct {
	Logger     logging.Logger
	Proxy      proxy.Proxy
	Ping       chan<- string
	PingTicker *time.Ticker
}

type Subscriber

type Subscriber struct {
	Name  string
	Topic string
	// pipe definition
	Endpoint *config.EndpointConfig
	// timeout of the pipe defined by this subscriber
	Timeout time.Duration
	// Endpoint Extra configuration for customized behaviour
	ExtraConfig config.ExtraConfig
	Workers     int
	MaxRate     float64
}

Subscriber defines the configuration of a single subscriber/consumer to be initialized and maintained by the lura service

Jump to

Keyboard shortcuts

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