Coro::PatchSet::LWP - fix Coro::LWP as much as possible
# load Coro::PatchSet::LWP before Coro::LWP or instead of Coro::LWP! use Coro::PatchSet::LWP; # or # use Coro::PatchSet 'lwp'; use Coro; use LWP; async { warn LWP::UserAgent->new->get('http://example.org')->status_line }
Nowadays LWP may use IO::Socket::INET6 or IO::Socket::IP as socket class instead of IO::Socket::INET. But Coro::LWP substitutes only IO::Socket::INET. So your LWP may become blocking because will still use blocking IO::Socket::INET6 or IO::Socket::IP. This patch fixes this. But note, it will not add IPv6 support for LWP, because Coro::Socket is still IPv4 only. See t/09_lwp_socket_class.t
Coro::LWP doesn't do any special hacks about https, so https connections still blocks coro threads. This patch fixes this problem, but don't forget to load it before IO::Socket::SSL, so use it as early as possible.
use
This patch will also load other necessary patches: Coro::PatchSet::Handle and Coro::PatchSet::Socket
Coro::PatchSet
Copyright Oleg G <oleg@cpan.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Coro::PatchSet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Coro::PatchSet
CPAN shell
perl -MCPAN -e shell install Coro::PatchSet
For more information on module installation, please visit the detailed CPAN module installation guide.