https://github.com/photon/worker-download
A worker to send large content without filling the RAM
https://github.com/photon/worker-download
Last synced: about 1 year ago
JSON representation
A worker to send large content without filling the RAM
- Host: GitHub
- URL: https://github.com/photon/worker-download
- Owner: photon
- License: lgpl-2.1
- Created: 2015-03-30T07:42:22.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T08:59:04.000Z (over 7 years ago)
- Last Synced: 2025-02-15T20:49:35.164Z (over 1 year ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
worker-download
==============
[](https://travis-ci.org/photon/worker-download)
A worker to stream just-in-time a HTTP Response from a iterator
Quick start
-----------
1) Add the module in your project
composer require "photon/worker-download"
2) Add the worker in the configuration
'installed_tasks' => array(
'PhotonDownload' => '\photon\task\PhotonDownload',
),
'photon_task_PhotonDownload' => array(
'sub_addr' => 'tcp://127.0.0.1:11011',
),
3) Start the worker
hnu worker PhotonDownload
4) Send work to the worker in a view
public function m2stream($request, $match)
{
$ans = new \photon\http\Response(new MyStream);
$ans->headers['Content-Length'] = 247463936;
\photon\task\PhotonDownload::createDownload($request, $ans);
return false;
}