In IO::Async 0.64 this worked fine.
In IO::Async 0.65, the CPU thrashes indefinitely, looping apparently because of IO::Async::Loop::Poll;
If you change the loop to Select or Epoll, it behaves fine.
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Async::Loop;
use Net::Async::HTTP;
my $loop = IO::Async::Loop->new;
my $http = Net::Async::HTTP->new;
$loop->add($http);
$http->do_request(
request => HTTP::Request->new(GET => 'http://google.com'),
on_response => sub { warn "RESP\n"; },
on_error => sub { warn "ERROR\n"; },
);
# Let's go!
$loop->run;
-- Matthew Horsfall (alh)