mheads/yii-table-export-queue
Composer 安装命令:
composer require mheads/yii-table-export-queue
包简介
Asynchronous table export queue integration for mheads/yii-table.
README 文档
README
Asynchronous table export module for Yii3/yiisoft projects. It extends mheads/yii-table: when a synchronous HTTP export cannot finish within the timeout, the export is queued, processed by a worker, and made available for later download.
Requirements
- PHP 8.3-8.5.
mheads/yii-table.yiisoft/dband the export table from the package migration.- An application queue connected via
QueueAdapterInterface. - A file registry connected via
FileRegistryInterface. The ready-to-useYiiFilestorageFileRegistryadapter is optional: it stores files withmheads/yii-filestorage, which must be installed separately if you choose this adapter.
Installation
Install the package with Composer:
composer require mheads/yii-table-export-queue
Apply the export table migration. See Migrations.
Quick Start
1. Configure Dependencies
Register the main interfaces:
RepositoryInterfacefor storing export records;TableRegistryInterfacefor restoring a table bytableId;QueueAdapterInterfacefor pushing jobs to the queue;FileRegistryInterfacefor storing the result file (YiiFilestorageFileRegistryis a ready-to-use adapter for a separately installedmheads/yii-filestorage);UserIdResolverInterfacefor resolving the current user.
Configuration example: Configuration.
2. Add HTTP Timeout Fallback
Use a timeout fallback orchestrator around the table HTTP orchestrator:
TableHttpOrchestratorWithTimeoutFallbackfor the common table endpoint;TableExportHttpOrchestratorWithTimeoutFallbackfor a dedicated export endpoint.
On ExportTimeoutException, the module creates a record with the queued status, pushes a job to the queue, and returns:
{
"status": "queued",
"exportId": "..."
}
3. Register User Actions
Register HTTP actions for exports owned by the current user:
- export table;
- export table configuration;
- export table rows;
- finished export download;
- export deletion or cancellation.
See User actions.
4. Run a Worker
The queue worker must receive the raw payload from your queue transport and pass it to JobPayloadConsumer::consume().
JobHandler will restore the table, apply the filter/sort snapshot, run the export, and store the file.
See Worker consumer.
5. Schedule Cleanup
Add table-export:cleanup to cron/scheduler to delete canceled and expired exports and mark stale running exports as failed.
See Cleanup command.
Documentation
License
BSD-3-Clause. See LICENSE.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-06-19