Documentation ¶
Index ¶
- Variables
- type Adapter
- func (q Adapter) Perform(job worker.Job) error
- func (q Adapter) PerformAt(job worker.Job, t time.Time) error
- func (q Adapter) PerformIn(job worker.Job, t time.Duration) error
- func (q *Adapter) Register(name string, h worker.Handler) error
- func (q *Adapter) Start(ctx context.Context) error
- func (q *Adapter) Stop() error
- type Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidConnection = errors.New("invalid connection")
ErrInvalidConnection is returned when the Connection opt is not defined.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct { Connection *amqp.Connection Channel *amqp.Channel Logger Logger // contains filtered or unexported fields }
Adapter implements the buffalo.Worker interface.
type Logger ¶
type Logger interface { Debugf(string, ...interface{}) Infof(string, ...interface{}) Errorf(string, ...interface{}) Debug(...interface{}) Info(...interface{}) Error(...interface{}) }
Logger is used by the worker to write logs
type Options ¶
type Options struct { // Connection is the AMQP connection to use. Connection *amqp.Connection // Logger is a logger interface to write the worker logs. Logger Logger // Name is used to identify the app as a consumer. Defaults to "buffalo". Name string // Exchange is used to customize the AMQP exchange name. Defaults to "". Exchange string // MaxConcurrency restricts the amount of workers in parallel. MaxConcurrency int }
Options are used to configure the AMQP Buffalo worker adapter.
Click to show internal directories.
Click to hide internal directories.