Download the PHP package dcarbone/ugly-queue without Composer
On this page you can find all versions of the php package dcarbone/ugly-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dcarbone/ugly-queue
More information about dcarbone/ugly-queue
Files in dcarbone/ugly-queue
Package ugly-queue
Short Description A simple file-based queue system for PHP 5.3.3+
License GPLv3
Homepage https://github.com/dcarbone/ugly-queue
Informations about the package ugly-queue
ugly-queue
A simple file-based FIFO queue system for PHP 5.3.3+
Installation
This library is designed to be installed into your app using https://getcomposer.org/.
Simply copy-paste the following line into your "requires:"
hash:
Basic Usage
Once installed, you must first initialize an instance of src/UglyQueueManager.php. This is done as such:
Once initialized, you can start adding queues!
Once you have items added to the queue, you can either pull items out ad-hoc or set up some sort of cron or schedule task to process items regularly.
If the base directory for all of your queues remains the same, each initialization
of UglyQueueManager
will automatically find and initialize instances of pre-existing
UglyQueues.
In a subsequent request, simply do the following:
The queue will then retain a single item, 0 => 'bread'
as the 5th item left in the queue.
At any time you can determine how many items remain in a queue by executing count($queueObj);
There are a few limitations currently:
- This lib is designed for small values without much in the way of formatting or line breaks
- It is designed to be atomic, meaning that only one process can be adding / retrieving items from a queue at a time. Reading actions (count, searching, etc) are NOT atomic, however.