Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 779 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 779 Bytes

AMQP worker adapter for Buffalo

This package implements the github.com/gobuffalo/buffalo/worker.Worker interface using the github.com/streadway/amqp package.

It allows AMQP-compatible message brokers, such as RabbitMQ, to process Buffalo's background tasks.

Setup

import "github.com/stanislas-m/amqp-work-adapter"
import "github.com/streadway/amqp"

// ...

conn, err := amqp.Dial("amqp://guest:guest@localhost:5672")
if err != nil {
    log.Fatal(err)
}

buffalo.New(buffalo.Options{
  // ...
  Worker: amqpw.New(amqpw.Options{
    Connection: conn,
    Name:           "myapp",
    MaxConcurrency: 25,
  }),
  // ...
})