Hi Stefan,
The primary advantage I see is that whatever libcurl features that Net::Curl exposes are now readily usable within Mojo. So libcurl’s http/2 support, for example, should be usable, as would non-HTTP protocols that libcurl supports like FTP, IMAP, etc. (Possibly even the experimental http/3 support?)
Other potential advantages would be speed (XS/C versus pure Perl) and, I would think, wider use: as much as Mojo is used in Perl, curl is used practically everywhere, with bindings in Python, Ruby, Rust, etc.
The disadvantage is that you’ll need to use Net::Curl::Easy, which isn’t a very Perlish interface. HTTP::AnyUA’s backend for same demonstrates how to “tame the beast”, though, and Net::Curl’s own documentation is quite helpful (IMO), so there’s at least copious prior art to reference.
I should disclaim here: I’ve not benchmarked this nor used it very extensively beyond just verifying that it works for simple parallel GETs. That said, since Net::Curl::Promiser is fairly simple, and Net::Curl itself has been around for a while and remains actively maintained, whatever gremlins may still lurk should be easy to find and fix.
-FG
> To view this discussion on the web visit
https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFTQyKHHKe1OLaCkfxdN%2B-SgkKtbMq18q93w8FOFdKox0A%40mail.gmail.com.