NAME
WWW::Crawler::Mojo::Queue - Crawler queue base class
SYNOPSIS
my $queue = WWW::Crawler::Mojo::Queue::Memory->new;
$queue->enqueue($job1);
$queue->enqueue($job2);
say $queue->length # 2
$job3 = $queue->next(); # $job3 = $job1
$job4 = $queue->dequeue(); # $job4 = $job1
say $queue->length # 1
DESCRIPTION
This class represents a FIFO queue.
ATTRIBUTES
fix
A hash whoes keys are md5 hashes of enqueued URLs.
jobs
jobs.
METHODS
dequeue
Shift the oldest job and returns it.
enqueue
Pushes a job.
next
Returns the oldest job.
length
Returns queue length
requeue
Pushes a job wether the job has been enqueued once or not.
shuffle
Shuffle the queue array.
AUTHOR
Sugama Keita, <sugama@jamadam.com>
COPYRIGHT AND LICENSE
Copyright (C) Sugama Keita.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.