The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Queue::Q::ReliableFIFO::Item - An item object of an queue item

SYNOPSIS

  use Queue::Q::ReliableFIFO::Item;
  my $item = Queue::Q::ReliableFIFO::Item->new(data => { id => 23 });
  my $time_created = $item->time_created;   # epoch time


  # items can be created from serialized data (to be used by 
  # Queue::Q::ReliableFIFO::Redis).
  my $item = Queue::Q::ReliableFIFO::Item->new(_serialized => $serialized);
  my $data = $item->data();
  my $last_error = $item->last_error();

METHODS

$item = new(data => $data)

Constructor for an item object (key "data" for plain data that needs to be serialized, key "_serialized" for data that needs to be deserialzed).

$data = $item->data()

Returns the data where the item was created from.

$time_created = $item->time_created()

Returns de time (epoch) the item was originally created (put in the queue).

$time_queued = $item->time_queued()

Returns de time (epoch) the item was put in the queue for the last time.

$n = $item->requeue_count()

Returns the number the item was requeued. Requeuing can happen when processing the item fails.

$n = $item->fail_count()

Returns the number the item was requeued. An item fails after the it has been retried up to requeue_limit times (See Redis.pm).

$n = $item->last_error()

Returns the last error message of processing this item.

inc_nr_requeues()

Increases the requeue counter of this item.