NAME

Net::Curl::Simple::Coro - Coro integration for blocking Net::Curl requests

SYNOPSIS

use Coro;
use Net::Curl::Simple;

my $c = async {
    Net::Curl::Simple->new()->get( $uri, \&finished );
    # this will be executed after finishing request
    ...
};

Net::Curl::Simple->new()->get( $uri2, \&finished );

# make sure we end all the threads before we finish
$c->join;

sub finished
{
    my ( $curl, $result ) = @_;
    print "document body: $curl->{body}\n";
}

DESCRIPTION

If you really need simultaneous blocking requests use Coro. If you don't need blocking requests use Net::Curl::Simple::Async instead.

This module will be loaded automatically if Coro is loaded already but Net::Curl::Simple::Async is not.

SEE ALSO

Coro Net::Curl::Simple::Async

COPYRIGHT

Copyright (c) 2011 Przemyslaw Iskra <sparky at pld-linux.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.