Herald van der Breggen > Queue-Q-0.12 > Queue::Q::ReliableFIFO::Item

Download:
Queue-Q-0.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source   Latest Release: Queue-Q-0.23

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).

$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.

syntax highlighting: