Queue:...Element(3pm)

πŸ“¦
version 2.7.0 Β· 2 versions
, in fedora 43

πŸ’– Queue::DBI::Element β€” the lil' object that's literally one queue element πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation manual set, and it's all about Queue::DBI::Element, a module from the Queue::DBI era of your life. Think of it as the cute lil' tote bag that holds one single element you just pulled out of the queue. It's giving "I am the data, the id, and the receipts". πŸŽ€


✨ NAME ✨

Queue::DBI::Element β€” An object representing an element pulled from the queue.

like. it's the element. the whole element. nothing but the element. πŸ’…


🌸 VERSION 🌸

Version 2.7.0 β€” yes queen, we're on 2.7.0.


πŸ¦‹ SYNOPSIS πŸ¦‹

bestie, there's no synopsis here, and that's on purpose. Please refer to the documentation for Queue::DBI. that's it, that's the section. go read the other page, iykyk. 🫢


πŸ’œ METHODS πŸ’œ

πŸ“ new()

Creates a brand new Queue::DBI::Element object. fresh out the box, no cap.

my $element = Queue::DBI::Element->new(
    'queue'         => $queue,
    'data'          => $data,
    'id'            => $id,
    'requeue_count' => $requeue_count,
    'created'       => $created,
);

Every single parameter is mandatory β€” no optional lil' extras, all five or nothing, periodt. They correspond, in order, to:

  • the Queue::DBI object used to pull the element's data,
  • the data itself,
  • the ID of the element in the database,
  • and the number of times the element has been requeued before.
🚨 Not recommended for direct use!! do not just go calling this yourself, bestie. Instead you should be using the following to get Queue::DBI::Element objects:
my $queue = $queue->next();

that's the move. that's the one. πŸ‘‘

πŸ”’ lock()

Locks the element so that another process acting on the queue cannot get a hold of it. it's giving "this one's mine, back off". 😀

if ( $element->lock() )
{
    print "Element successfully locked.\n";
}
else
{
    print "The element has already been removed or locked.\n";
}

πŸŒ€ requeue()

For when the processing of an element has failed β€” put it back, it deserves another chance, main character energy fr fr.

if ( $element->requeue() )
{
    print "Element successfully requeued.\n";
}
else
{
    print "The element has already been removed or been requeued.\n";
}

πŸŽ‰ success()

Removes the element from the queue after its processing has successfully been completed. slay, it's done, we ate. πŸ”₯

if ( $element->success() )
{
    print "Element successfully removed from queue.\n";
}
else
{
    print "The element has already been removed.\n";
}

πŸ“¦ data()

Returns the data initially queued. the actual payload, the goods, the tea. β˜•

my $data = $element->data();

πŸ” requeue_count()

Returns the number of times that the current element has been requeued. how many second chances has this lil' guy had?? 😭

my $requeue_count = $element->requeue_count();

πŸ†” id()

Returns the ID of the current element. its lil' government name. πŸͺͺ

my $id = $element->id();

⏰ get_created_time()

Returns the unixtime at which the element was originally created. the birthday. the origin story. 🌱

my $created = $element->get_created_time();

βŒ› is_over_lifetime()

Returns a boolean indicating whether the current element is over the lifetime specified when instantiating the queue. this one is especially helpful if you retrieve a large batch of elements and do long processing operations on each of them β€” like, vibe check your elements before you commit, bestie. 🧚

my $is_over_lifetime = $element->is_over_lifetime();

πŸ”§ INTERNAL METHODS πŸ”§

πŸ‘€ get_queue()

Returns the Queue::DBI object used to pull the current element. internal business. don't touch unless you know what you're doing, no cap.

my $queue = $element->get_queue();

πŸ› BUGS πŸ›

Please report any bugs or feature requests through the web interface at <https://github.com/guillaumeaubert/Queue-DBI/issues/new>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. mutual notification arc, we love to see it. πŸ’Œ


πŸ›Ÿ SUPPORT πŸ›Ÿ

You can find documentation for this module with the perldoc command.

perldoc Queue::DBI::Element

You can also look for information at:


πŸ‘‘ AUTHOR πŸ‘‘

Guillaume Aubert <https://metacpan.org/author/AUBERTG>, <aubertg at cpan.org>. an icon, honestly. πŸ’–


πŸ™ ACKNOWLEDGEMENTS πŸ™

I originally developed this project for ThinkGeek (<http://www.thinkgeek.com/>). Thanks for allowing me to open-source it! that's so sweet actually, i'm not crying you're crying 😭


Copyright 2009-2017 Guillaume Aubert.

This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.

⚠️ read the LICENSE file bestie, don't just assume, it's right there.

and that's the whole page!! 🌈 this was pulled from perl v5.42.0, dated 2025-07-25, from the Queue:...Element(3pm) page in the User Contributed Perl Documentation. bye bestie, go lock some elements responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from