Created
August 25, 2016 13:05
-
-
Save renatocron/bd3a3f8c9d35bca0ab1c799de62fa4f5 to your computer and use it in GitHub Desktop.
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 strict; | |
use HTTP::Async; | |
use HTTP::Request; | |
use IO::Socket::SSL qw(debug4); | |
use URI; | |
my $async = HTTP::Async->new( ); | |
my $a = HTTP::Request->new( | |
GET => 'https://eokoe.com', | |
[ | |
] | |
); | |
print STDERR $a->as_string; | |
# create some requests and add them to the queue. | |
$async->add($a); | |
while ( $async->not_empty ) { | |
if ( my $response = $async->next_response ) { | |
print STDERR $response->as_string; | |
} | |
else { | |
# do something else | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment