Getting Started
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide will help you set up JoobQ, a high-performance job queue system for the Crystal programming language. Follow these steps to integrate JoobQ into your project and start managing background jobs efficiently.
Before installing JoobQ, ensure your system meets the following requirements:
Crystal Language: Version 1.0 or later. .
Redis: JoobQ uses Redis as its backend for queue management. Ensure Redis is installed and running on your system.
Install Redis: .
JoobQ is a robust job queue and scheduler library for the Crystal programming language, designed to handle background tasks efficiently. Depending on your application's architecture, you can set up JoobQ in three distinct configurations:
Client Only: For applications that enqueue jobs without processing them locally.
Client with Embedded Server: For applications that both enqueue and process jobs within the same environment.
Server Only: For dedicated job processing servers that handle jobs from multiple clients.
Below are detailed installation and configuration guides for each setup.
This configuration is ideal for applications that need to enqueue jobs to be processed by external workers.
Add JoobQ to Your Project
Include JoobQ in your shard.yml
dependencies:
Install Dependencies
Run the following command to install the dependencies:
Configure JoobQ
Set up JoobQ to connect to the Redis server:
Enqueue Jobs
Define your job classes and enqueue jobs as needed:
This setup is suitable for applications that enqueue and process jobs within the same environment.
Add JoobQ to Your Project Include JoobQ in your shard.yml
dependencies:
Install Dependencies Run the following command to install the dependencies:
Configure JoobQ Set up JoobQ with queue definitions and scheduling:
Start the JoobQ Server Run the following command to start processing jobs:
This configuration is intended for dedicated servers that process jobs from multiple clients.
Add JoobQ to Your Project
Include JoobQ in your shard.yml
dependencies:
Install Dependencies
Run the following command to install the dependencies:
Configure JoobQ
Set up JoobQ with queue definitions:
Start the JoobQ Server
Run the following command to start processing jobs:
By following the appropriate setup guide, you can configure JoobQ to match your application's architecture, ensuring efficient job queuing and processing.
REST API: Enable the REST API for monitoring queues and jobs:
Cron Schedules: Use cron-like expressions for job scheduling:
Middlewares: Customize job execution with middleware:
Redis Connection Issues: Ensure Redis is running and accessible at the default host (localhost
) and port (6379
).
Missing Jobs: Confirm that all job classes are required in your application.
Worker Not Processing Jobs: Verify that the worker process is running and that jobs are being enqueued.
Congratulations! JoobQ is now installed and ready to handle your background tasks. Explore the JoobQ Documentation for advanced configurations and features.
Crystal Language: Ensure Crystal is installed on your system.
Redis Server: JoobQ utilizes Redis for job storage.
Crystal Language: Ensure Crystal is installed on your system.
Redis Server: JoobQ utilizes Redis for job storage.
Crystal Language: Ensure Crystal is installed on your system.
Redis Server: JoobQ utilizes Redis for job storage.