|Ratings|| ||Unique User Downloads|| ||Download Rankings|
| 73%||Total: 737 ||All time: 4,476 This week: 292|
This package can start background tasks and query progress status.
There is a class that can start a background task by sending a HTTP request to a URL of a script that do the actual work on the background.
Another class can query the task progress status by polling on a given status file.
The status responses can be encoded in JSON to make it easy for processing from browser side AJAX based applications.
Prize: One subscription to the PDF edition of the PHP Architect magazine
|Sometimes applications need to perform tasks that time a long time to complete, like for instance sending a newsletter to many subscribers.
If you send a request from the browser to execute such long server tasks, the browser will stall waiting for the job to finish.
This package provides an alternative solution that frees the browser once the long server task is started.
It also provides means to poll the server to learn about the status of progress of the long task that is still running.
A wrapper to implement asynchronous server taks in your PHP project
remember to run first
` in order to generate the appropriate autoload files
To run the example:
create a virtual a host with "your-local-name" in your development environment:
now, go to your browser and write http://your-local-name and you'll see a simple page with a button to start a new task
and an area to see messages.
A little complex example
This example serves as a base to document the second part of the article on PHP Classes
Go in your browser to http://your-local-name/file-list.php
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.