2017 © Pedro Peláez
 

library tasks

Simple way to manage delayed execution in PHP scripts

image

jamm/tasks

Simple way to manage delayed execution in PHP scripts

  • Monday, August 12, 2013
  • by OZ
  • Repository
  • 4 Watchers
  • 26 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Tasks

Simple way to manage delayed execution in PHP scripts
Build Status, (*1)

Where can it be used

It can be used to execute delayed tasks - tasks, which takes long time to execute and result of their execution isn't necessary to generate output of requested script.
For example, it can be sending mail, or long database queries, or checking some info (IP whois data), delayed collaborating with remote API., (*2)

How to use

Tasks it's a base to build your task-handlers.
Task-handlers it's classes, which will store tasks (when called from script) and execute restored tasks (when called from cron-script).
See example of task-handler in MailDelayed.php, (*3)

To execute tasks, \Tasks\Executor should be called, it's usual work for cron - see tasks_cron.php for example., (*4)

Examples

How to create Task-class

See MailDelayed.php, (*5)

How to use Task-class

$taskStorage = new MemStorage(new \Jamm\Memory\RedisObject('tasks'));

$mailer = new MailDelayed($taskStorage);
$mailer->Send('to@example.com', 'Re: Hello', 'Hi, To!', 3);

Requirements

PHP version: 5.3+

To store tasks in memory:

Any object, implements Jamm\Memory\IMemoryStorage. For example, Jamm\Memory\RedisObject, (*6)

Files storage

No any external classes are required, (*7)

TODO:

  • Track results of tasks execution
  • Auto-repeated tasks

The Versions

12/08 2013

dev-master

9999999-dev

Simple way to manage delayed execution in PHP scripts

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

task tasks delayed execution