Pluf_Queue Class Reference

Inheritance diagram for Pluf_Queue:

Pluf_Model

List of all members.

Public Member Functions

 init ()
 preSave ($create=false)

Static Public Member Functions

static addTo ($object, $action='')

Public Attributes

 $_model = __CLASS__


Detailed Description

Simple queue system to delay the processing of tasks.

What you do is that you push in the queue an object and what was done on the object. Then later one, a simple script will go through the queue and will check if something has to be done for the given object.

For example, you have articles with for each articles a list of authors. You want to index the article with also the name of the authors. So it means that you need to update the index when an author is changed and when an article is changed. But you do not want to do the indexing of all the articles of an author when you update the author information (if this take 0.5s per article, with 100 articles, you would have to wait nearly 1 minute!).

So when you update an author you push in the queue: "author x has been updated". Then you have a script that will go in the queue, find that the author has been updated and index each of his articles.


Member Function Documentation

Pluf_Queue::init (  ) 

Reimplemented from Pluf_Model.

Pluf_Queue::preSave ( create = false  ) 

Hook run just before saving a model in the database.

Just overwrite it into your model to perform custom actions.

Parameters:
bool Create.

Reimplemented from Pluf_Model.

static Pluf_Queue::addTo ( object,
action = '' 
) [static]

Add an object to the queue.

Parameters:
Pluf_Model Your model
string Action for the object


Member Data Documentation

Pluf_Queue::$_model = __CLASS__

Reimplemented from Pluf_Model.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen