A simple Python-based queue poller for processing background jobs using Supabase pgmq queue and Resend for email processing.
- Install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh- Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt- Create a
.envfile with the following variables:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
RESEND_API_KEY=your_resend_api_key
POLL_BATCH_SIZE=10 # Optional, defaults to 10
VISIBILITY_TIMEOUT=3600 # Optional, defaults to 3600 secondsdeno run dev- Create a new service in Railway
- Connect your GitHub repository
- Set the environment variables in Railway's dashboard
- Deploy!
The service will automatically start the queue poller when deployed.