Download the PHP package tinywan/redis-stream without Composer

On this page you can find all versions of the php package tinywan/redis-stream. 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 redis-stream

🚀 Redis Stream Queue

Latest Version on Packagist Total Downloads License PHP Version Redis Version Tests

🚀 基于 Redis Streams 的高性能轻量级 PHP 队列

✨ 特性

📋 环境要求

🚀 快速安装

🎯 快速开始

基础使用

创建队列实例

发送消息

消费消息

使用 Producer 和 Consumer

📊 架构流程

核心组件

层级 组件 功能描述
📤 生产者层 Producer 高级消息发送接口,支持单条和批量发送
Delay Queue 基于 Redis Sorted Set 的延时任务队列
🏗️ 队列核心层 RedisStreamQueue 主要队列类,处理 Redis 连接和消息生命周期
RedisConnectionPool Redis 连接池管理器,自动连接复用
MonologFactory Monolog 日志工厂,支持多种日志方式
🗄️ 存储层 Redis Stream Redis 5.0+ 消息流,持久化消息存储
Sorted Set 延时任务队列,按时间戳排序
Consumer Group 消费者组管理,支持并行消费
📥 消费者层 Consumer 高级消息消费接口,具有重试逻辑和内存管理
Message Handler 自定义消息处理器接口
Special Features 消息重放、审计、指定位置消费等高级功能

数据流向图

核心特性说明

🔄 消息流转过程

  1. 生产者发送消息到队列核心
  2. 延时队列处理需要延迟的消息
  3. 队列核心管理连接池和消息生命周期
  4. Redis存储提供持久化和消费组管理
  5. 消费者接收消息并调用处理器
  6. 特殊功能提供消息重放、审计等高级操作

⚡ 性能优化

📖 主要功能

延时消息

支持秒级到年级的任意时长延时:

消息重放与审计

支持重新处理历史消息和只读审计:

指定位置消费

灵活的消费位置控制:

⚙️ 配置

Redis 配置

队列配置

🚀 生产部署

Supervisor 配置

Docker 部署

📊 性能基准

操作 QPS 延迟 (P95)
发送消息 50,000+ 2ms
消费消息 30,000+ 3ms
延时消息调度 100,000+ 1ms

测试环境:Intel i7-10700K, Redis 7.0, PHP 8.1

🔧 高级功能

单例模式管理

延迟队列管理

队列监控

🛠️ 框架集成

Laravel 集成

ThinkPHP 集成

❓ 常见问题

Q: 如何处理消息丢失? A: 启用 Redis 的 AOF 或 RDB 持久化,使用消费者组确保消息被正确确认。

Q: 延时消息的精度如何? A: 默认检查间隔为 1 秒,支持秒级到年级的任意时长延时。

Q: 如何处理高并发场景? A: 使用单例模式,配置合适的连接池大小,使用多个消费者进程并行处理。

Q: 如何监控队列状态? A: 使用 getStreamLength()getPendingCount()getDelayedQueueLength() 等方法监控状态。

🧪 运行示例

🤝 贡献

欢迎贡献代码!请遵循 PSR-12 编码规范,添加适当的测试,确保所有测试通过。

  1. Fork 仓库
  2. 创建功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送分支 (git push origin feature/AmazingFeature)
  5. 打开 Pull Request

📄 开源协议

本项目采用 MIT 协议开源。详情请查看 LICENSE 文件。


Made with ❤️ by Tinywan

All versions of redis-stream with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4||^8.0
ext-redis Version *
ext-json Version *
monolog/monolog Version ^2.10
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 tinywan/redis-stream contains the following files

Loading the files please wait ...