This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Mojo::Base -strict; | |
| use feature 'current_sub'; | |
| use Mojo::IOLoop; | |
| my $concurrency = 100; | |
| # this is dummy data, fill it with your data to be processed | |
| my @items = (1..1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Mojo::Base -strict; | |
| use Mojo::IOLoop::LineReader; | |
| use Mojo::UserAgent; | |
| use Mojo::IOLoop; | |
| use Data::Dump 'pp'; | |
| use File::Temp qw(tempfile :seekable); | |
| sub run { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| package Mojo::URLQueue; | |
| use Mojo::Base 'Mojo::EventEmitter'; | |
| use Mojo::UserAgent; | |
| has queue => sub { [] }; | |
| has ua => sub { Mojo::UserAgent->new(max_redirects => 5) }; | |
| has concurrency => 4; |