Wednesday 11 November 2009

Software: Bounded Queue, a PHP Class

I wrote a PHP class called the Bounded Queue that might be of use to people. It is released under the New BSD license so go ahead and use it freely if you want.

The guys at PHPClasses.org gave it this description: This class can be used to manage a queue with a limited number of elements. It can push and pop items of any type into a queue array. If the queue already contains the limit number of items when a new item is pushed, the item at the bottom of the queue is popped (shifted) out.

Technically, this queue is bidirectional and you can even insert or remove items from the middle of the queue and even change its size dynamically. Here it is:

http://www.phpclasses.org/bounded-queue

PHPClasses.org have considered the class to be "Noteable". "This means that the site users interested in packages that have something special, are being notified to pay special attention to your package." Cool :)

If you do decide to use it then please tell me what for and warn me about any bugs. Thanks.

No comments:

Post a Comment