The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Curl::Promiser::IOAsync - support for IO::Async

SYNOPSIS

    my $loop = IO::Async::Loop->new();

    my $promiser = Net::Curl::Promiser::IOAsync->new($loop);

    my $handle = Net::Curl::Easy->new();
    $handle->setopt( CURLOPT_URL() => $url );

    $promiser->add_handle($handle)->then(
        sub { print "$url completed.$/" },
        sub { warn "$url failed: " . shift },
    )->finally( sub { $loop->stop() } );

    $loop->run();

DESCRIPTION

This module provides an IO::Async-compatible subclass of Net::Curl::Promiser.

See /examples in the distribution, as well as the tests, for fleshed-out demonstrations.

NOTE: This class’s constructor requires an IO::Async::Loop instance.