Queue::DBI::Element - An object representing an element pulled from the queue
Version 1.6
Please refer to the documentation for Queue::DBI.
Create a new Queue::DBI::Element object.
my $element = Queue::DBI::Element->new( 'queue' => $queue, 'data' => $data, 'id' => $id, 'requeue_count' => $requeue_count, );
All parameters are mandatory and correspond respectively to the Queue::DBI object used to pull the element's data, the data, the ID of the element in the database and the number of times the element has been requeued before.
It is not recommended for direct use. You should be using the following to get Queue::DBI::Element objects:
my $queue = $queue->next();
Locks the element so that another process acting on the queue cannot get a hold of it
if ( $element->lock() ) { print "Element successfully locked.\n"; } else { print "The element has already been removed or locked.\n"; }
In case the processing of an element has failed
if ( $element->requeue() ) { print "Element successfully requeued.\n"; } else { print "The element has already been removed or been requeued.\n"; }
Removes the element from the queue after its processing has successfully been completed.
if ( $element->success() ) { print "Element successfully removed from queue.\n"; } else { print "The element has already been removed.\n"; }
Returns the data initially queued.
my $data = $element->data();
Returns the number of times that the current element has been requeued.
Returns the ID of the current element
my $id = $element->id();
Returns the Queue::DBI object used to pull the current element.
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Please report any bugs or feature requests to bug-queue-safe at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Queue-DBI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-queue-safe at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Queue::DBI
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Queue-DBI
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Queue-DBI
CPAN Ratings
http://cpanratings.perl.org/d/Queue-DBI
Search CPAN
http://search.cpan.org/dist/Queue-DBI/
Thanks to Geeknet, Inc. http://www.geek.net for funding the initial development of this code!
Copyright 2009 Guillaume Aubert.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Queue::DBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Queue::DBI
CPAN shell
perl -MCPAN -e shell install Queue::DBI
For more information on module installation, please visit the detailed CPAN module installation guide.