> > Another big disadvantage is that it doesn't use Mojo::Promise. I don't 
> > think it will attract too many Mojo users without.
>
> The latest version does, actually.

Ah, nice. Then you can simplify your example too.

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

    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 },
    )->wait;

And if you really want to conform to the Mojo style you rename
add_handle to add_handle_p, because we like to make promise
returning methods obvious. ;)

-- 
Sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CANn9nhFX%2BA7gFmZAL3z67zNN2%3DNi1rOkhuhEauu9ZJ_hBhfFMA%40mail.gmail.com.

Reply via email to