1 package POE::XS::Queue::Array;
3 use vars qw(@ISA $VERSION);
13 # try XSLoader first, DynaLoader has annoying baggage
15 XSLoader::load('POE::XS::Queue::Array' => $VERSION);
19 push @ISA, 'DynaLoader';
20 bootstrap POE::XS::Queue::Array $VERSION;
24 # lifted from POE::Queue::Array
25 sub ITEM_PRIORITY () { 0 }
27 sub ITEM_PAYLOAD () { 2 }
30 my $package = caller();
32 *{ $package . '::ITEM_PRIORITY' } = \&ITEM_PRIORITY;
33 *{ $package . '::ITEM_ID' } = \&ITEM_ID;
34 *{ $package . '::ITEM_PAYLOAD' } = \&ITEM_PAYLOAD;
37 # everything else is XS
44 POE::XS::Queue::Array - an XS implementation of POE::Queue::Array.
52 This class is an implementation of the abstract POE::Queue interface.
53 It implements a priority queue using C, with an XS interface supplied.
55 The current implementation could use some optimization, especially for
58 Please see the POE::Queue documentation, which explainsthis one's
59 functions, features, and behavior.
63 POE, POE::Queue, POE::Queue::Array
69 Some possible improvements include:
75 use binary searches for large queues
79 use a B-Tree for the queue (not a binary tree, a B-Tree), though this
80 would require a module rename.
84 use a custom hash instead of a HV for the id to priority mapping,
85 either glib's hash or convert to C++ and use the STL map.
89 some of the XS code could be optimized to do less work in scalar
90 context, pq_remove_items and pq_peek_items could avoid building all
97 Tony Cook <tonyc@cpan.org>