Download the PHP package stietotalwin/stw-sdk-php-redis-queue without Composer

On this page you can find all versions of the php package stietotalwin/stw-sdk-php-redis-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stw-sdk-php-redis-queue

StieTotalWin Redis Queue

A generic Redis-based queue library for CodeIgniter 4 framework that provides reliable job processing with support for delayed jobs, retries, and failure handling.

Features

Requirements

Installation

Install via Composer:

Upgrading from 0.1.x to 2.0

2.0 raises the platform floor and fixes three queue-correctness bugs. There are no application API changes — publish(), consume(), markCompleted() and markFailed() keep their existing signatures.

After upgrading, restart your workers — long-running consumers keep the code they started with, so a composer update alone changes nothing.

Configuration

Create a configuration file app/Config/RedisQueue.php:

Configuration for Cloud Redis (e.g., Upstash)

Usage

Publishing Jobs

Consuming Jobs

Queue Management

Failed Job Management

Job Object Properties

The Job class provides access to job information:

Queue Structure

The library uses the following Redis data structures:

Configuration Options

Option Default Description
scheme tcp Redis connection scheme (tcp, tls, unix)
host 127.0.0.1 Redis server host
port 6379 Redis server port
user null Redis username (for cloud services)
password null Redis password (if required)
database null Redis database number (optional for cloud)
parameters [] Additional Predis client parameters
defaultQueue default Default queue name
maxAttempts 3 Maximum retry attempts for failed jobs
retryDelay 60 Base retry delay in seconds
jobTtl 86400 Job time-to-live in seconds
cleanupInterval 3600 Cleanup interval in seconds

Advanced Features

Job Recovery and Maintenance

The library includes advanced recovery and maintenance features:

Memory Management

The consumer includes built-in memory monitoring:

Atomic Operations

The library uses Lua scripts for atomic operations to ensure data consistency:

Error Handling

The library provides robust error handling:

Best Practices

  1. Use Specific Queue Names: Create separate queues for different job types
  2. Handle Exceptions: Always wrap job processing in try-catch blocks
  3. Monitor Failed Jobs: Regularly check and handle failed jobs
  4. Set Appropriate TTL: Configure job TTL based on your use case
  5. Clean Up Regularly: Use the cleanup functionality to remove expired jobs
  6. Use Delays Wisely: For time-sensitive jobs, use delays instead of immediate processing
  7. Secure Connections: Use TLS scheme for production Redis connections
  8. Connection Pooling: Consider using connection pooling for high-throughput applications
  9. Monitor Memory Usage: Enable detailed logging during development to monitor memory usage
  10. Run Recovery Operations: Periodically check and run recovery operations for stuck jobs
  11. Batch Processing: Use appropriate batch sizes for cleanup operations on large queues
  12. Data Validation: Always validate and decode JSON data from jobs before processing

License

This library is licensed under the MIT License. See the LICENSE file for details.

Support

For issues and questions, please contact: [email protected]


All versions of stw-sdk-php-redis-queue with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
predis/predis Version ^3.1
ramsey/uuid Version ^4.2
codeigniter4/framework Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stietotalwin/stw-sdk-php-redis-queue contains the following files

Loading the files please wait ...