POE::XS::Queue::Array - an XS implementation of POE::Queue::Array.


See POE::Queue.


This class is an implementation of the abstract POE::Queue interface. It implements a priority queue using C, with an XS interface supplied.

The current implementation could use some optimization, especially for large queues.

Please see the POE::Queue documentation, which explains this one's functions, features, and behavior.

The following extra methods are added beyond POE::Queue::Array:


Dumps the internal structure of the queue to stderr.


Does limited verification of the structure of the queue. If the verification fails then a message is sent to stderr and the queue is dumped as with the dump() method, and your program will exit.


POE, POE::Queue, POE::Queue::Array


None known.

Some possible improvements include:

  • use a B-Tree for the queue (not a binary tree, a B-Tree), though this would require a module rename.

  • use a custom hash instead of a HV for the id to priority mapping, either glib's hash or convert to C++ and use the STL map.

  • some of the XS code could be optimized to do less work in scalar context, pq_remove_items and pq_peek_items could avoid building all those array refs.


POE::XS::Queue::Array is licensed under the same terms as Perl itself.


Tony Cook <>