pnz/messenger-filesystem-transport
最新稳定版本:v0.1.3
Composer 安装命令:
composer require pnz/messenger-filesystem-transport
包简介
Symfony Messenger transport for the filesystem.
README 文档
README
Extends the Symfony Messenger component to handle the filesystem transport. Queues are processed locally by storing and retrieving messages from the filesystem.
The queuing is implemented as a LIFO (Last-In, First-Out) list, this to optimize the filesystem usage and the r/w operations.
Install
composer require pnz/messenger-filesystem-transport
This transport handles the filesystem:// schema, use the FilesystemTransportFactory
to create the transport.
Symfony configuration: use the Filesystem Transport Bundle Bundle.
Install without the Symfony Bundle:
- Register the transport factory:
# config/services.yaml Pnz\Messenger\FilesystemTransport\FilesystemTransportFactory: arguments: $serializer: '@messenger.transport.symfony_serializer' # The following lines are not needed if "autowire" is enabled $filesystem: '@filesystem' $lockFactory: '@lock.factory' # Enable the `filesystem://` transport to be auto-discovered, this is not needed when "autoconfigure" is enabled tags: ['messenger.transport_factory']
- Configure the Filesystem transport:
# config/packages/messenger.yaml parameters: # The path *MUST* specify an absolute path of the directory where the queue will be stored # Example1: the queue messages will be stored in the project's `var/queue` directory env(MESSENGER_TRANSPORT_DSN): "filesystem://%kernel.project_dir%/var/queue" # Example2: use the `/tmp/queue` directory (note the triple `/`) env(MESSENGER_TRANSPORT_DSN): "filesystem:///tmp/queue" framework: messenger: transports: filesystem: '%env(resolve:MESSENGER_TRANSPORT_DSN)%' routing: App\Message\MyMessage: filesystem
Configuration
The DSN includes the following query parameters:
compress: Enable/Disable compression of messages storage (gzinflate/gzdeflate), usecompress=true(default: false)loop_sleep: Define the sleep interval between loops in micro-seconds, useloop_sleep=MICRO-SECONDS(default: 500000)
Example:
# .env # Enable compression, and sleep for 0.8 seconds during loops if the queue is empty MESSENGER_TRANSPORT_DSN="filesystem://%kernel.project_dir%/var/queue/default?compress=true&loop_sleep=800000"
pnz/messenger-filesystem-transport 适用场景与选型建议
pnz/messenger-filesystem-transport 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.89k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2018 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「queue」 「symfony」 「filesystem」 「Messenger」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pnz/messenger-filesystem-transport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pnz/messenger-filesystem-transport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pnz/messenger-filesystem-transport 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
A PHP class providing static methods for reading, writing, copying, moving, and deleting files and directories, MIME type detection, image size detection, and file permission management
PHP AMQP Binding Library
The bundle for easy using json-rpc api on your project
A Laravel package to monitor queue jobs.
The flysystem adapter for yandex disk rest api.
统计信息
- 总下载量: 1.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 19
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-01