An example of how to setup bullmq with Remix. Our redis connection is provided by the ioredis example and can be referenced for more information.
Open this example on CodeSandbox:
- Use your existing redis server or install new redis server or start redis server with docker.
- Duplicate the local
.env.example
file to.env
and change theREDIS_URL
environment variable to your redis server URL. - Run
npm install
- Run
npm run dev
- app/utils/notifier.server.ts where we define the necessary components for the background task queue, worker, and scheduler.
- app/routes/index.tsx where background tasks are added to the queue.