Documentation
Background workers
Run long-lived processes like queue consumers, bots and stream processors on Rebasable.
A background worker runs continuously, like a web service, but receives no HTTP traffic and has no public URL. Use it for queue consumers (Sidekiq, Celery, BullMQ, RQ), bots, schedulers and stream processors.
Create one
New → Background worker, choose the repository and set the start command:
| Stack | Start command |
|---|---|
| Node.js + BullMQ | node dist/worker.js |
| Python + Celery | celery -A proj worker -l info |
| Ruby + Sidekiq | bundle exec sidekiq |
| Laravel | php artisan queue:work --tries=3 |
rebasable services create emails-worker --type worker --start-cmd "node dist/worker.js"
Workers use paid instance types (from Starter). They restart automatically when they crash, and crashes show up as events and notifications.
Talking to other services
Workers join your team’s private network. Reach a Key Value store, a database or a private service through its internal URL.
Graceful shutdown
On deploys and restarts we send SIGTERM, then SIGKILL after the shutdown delay you configure. Finish the current job and exit on SIGTERM to avoid losing work.
Scaling
Run several instances to consume a queue in parallel (rebasable scale emails-worker 3), or enable autoscaling.