Server v0.5.3Release notes

Background jobs for every language in your stack

Anway is one small server for background jobs. Your Rails app, your Go services, and your Node.js APIs push jobs to the same queues, and workers in any of these languages run them.

A Hobby server on Anway Cloud is free forever. No card needed.

docker run -p 7419:7419 -v anway-data:/data ghcr.io/thadeu/anway
RailsGoNode.jsanway:7419Queues on diskdefault1,204mailers86products3,410Scheduled48Retries12Dead0RubyGoNode.js

One event, three services

A Go service publishes order.paid. The Rails app sends the receipt, and a Node.js service updates the reports. Each subscriber gets its own copy of the event, in its own queue, with its own retries. A slow subscriber never blocks the others.

Gocheckout/paid.goPublishes
opts := anway.PublishOptions{ID: order.ID}

_, err := client.Publish(
	ctx,
	"order.paid",
	[]any{order},
	opts,
)

if err != nil {
	return err
}

log.Printf("order %s published", order.ID)

return nil
Rubyapp/jobs/send_receipt.rbSubscribes
class SendReceipt
  include Anway::Worker

  anway_options(
    queue: "mailers",
    topics: %w[order.paid]
  )

  def perform(order)
    ReceiptMailer
      .paid(order)
      .deliver_now
  end
end
Node.jsreports/worker.tsSubscribes
import Anway from '@anway/client';

const worker = new Anway.Worker();

const subscribe = {
  queue: 'reports',
  topics: ['order.paid'],
};

worker.on(
  'reports.order',
  async job => {
    await reports.add(job.args[0]);
  },
  subscribe,
);

await worker.run();

Read how topics work

See every job as it runs

  • Throughput and threads on one chart, with a drag to zoom into a time slice
  • Queues, workers, topics, and schedules, live as they change
  • Retry, delete, pause, and scale from the browser
The Anway web console: job counts, a throughput chart with a threads line, queues, workers, and running jobs.

Tap the image to see it at full size.

Run the console

Start where your app is

Anway speaks the Faktory work protocol, so Faktory clients in other languages connect too.

Inside a Rails app

The gem carries the server for your platform, and bin/dev starts it with Puma. No Redis, and no migrations.

bundle add anway
bin/rails generate anway:install
bin/dev
Ruby and Rails guide

As a container

One image for amd64 and arm64. Keep /data on a volume, and set a password before other hosts connect.

docker run -p 7419:7419 -e SERVER_PASSWORD=change-me -v anway-data:/data ghcr.io/thadeu/anway
Docker guide

With Go or Node.js

Add the client, and set ANWAY_URL to the server address. Workers and pushes use the same URL.

go get github.com/thadeu/anway-go
pnpm add @anway/client
Go and Node.js guides