WWW::Crawler::Mojo::Queue - Crawler queue base class
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
This class represents a FIFO queue.
A hash whoes keys are md5 hashes of enqueued URLs.
jobs.
Shift the oldest job and returns it.
Pushes a job.
Returns the oldest job.
Returns queue length
Pushes a job wether the job has been enqueued once or not.
Shuffle the queue array.
Sugama Keita, <sugama@jamadam.com>
Copyright (C) Sugama Keita.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Crawler::Mojo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Crawler::Mojo
CPAN shell
perl -MCPAN -e shell install WWW::Crawler::Mojo
For more information on module installation, please visit the detailed CPAN module installation guide.