Badger
Docs / Introduction

Getting started

This page sets up Badger with a local PostgreSQL and runs a first job. It assumes Badger is installed.

Create the tables

$ export BADGER_DATABASE_URL=postgres://localhost/app
$ badger migrate
applied 6 migrations to schema badger

Start a worker

Your application needs an endpoint that runs jobs. For a first try, any server that answers 200 will do:

$ badger worker --concurrency 2
worker started: queues=default concurrency=2

Enqueue a job

In another terminal:

$ badger enqueue send_welcome '{"user": 42}'
enqueued job 1

The worker picks the job up right away and logs the result.

Next steps