Download the PHP package mheads/yii-table-export-queue without Composer
On this page you can find all versions of the php package mheads/yii-table-export-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mheads/yii-table-export-queue
More information about mheads/yii-table-export-queue
Files in mheads/yii-table-export-queue
Package yii-table-export-queue
Short Description Asynchronous table export queue integration for mheads/yii-table.
License BSD-3-Clause
Informations about the package yii-table-export-queue
Table Export Queue
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:
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:
See HTTP timeout fallback.
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
- Guide
License
BSD-3-Clause. See LICENSE.
All versions of yii-table-export-queue with dependencies
yiisoft/db Version ^2.0.1
psr/http-message Version ^2.0
mheads/yii-table Version ^1.0
psr/http-server-handler Version ^1.0
yiisoft/input-http Version ^1.0
yiisoft/yii-console Version ^2.4
yiisoft/data-db Version ^1.0
httpsoft/http-message Version ^1.1