View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
ikegami > LWP-Protocol-AnyEvent-http-v1.8.0 > LWP::Protocol::AnyEvent::http



Annotate this POD


Open  0
View/Report Bugs
Module Version: v1.8.0   Source   Latest Release: LWP-Protocol-AnyEvent-http-v1.14.0


LWP::Protocol::AnyEvent::http - Event loop friendly HTTP and HTTPS backend for LWP


Version 1.8.0


    # Make HTTP and HTTPS requests friendly to event loops.
    use LWP::Protocol::AnyEvent::http;

    # Or LWP::Simple, WWW::Mechanize, etc
    use LWP::UserAgent;

    # A reason to want LWP friendly to event loops.
    use Coro qw( async );

    my $ua = LWP::UserAgent->new();
    $ua->protocols_allowed([qw( http https )]);  # Playing it safe.

    for my $url (@urls) {
        async { process( $ua->get($url) ) };


LWP performs a number of blocking calls when trying to process requests. This makes it unfriendly to event-driven systems and cooperative multitasking system such as Coro.

This module makes LWP more friendly to these systems by plugging in an HTTP and HTTPS protocol implementor powered by AnyEvent and AnyEvent::HTTP.

This module is known to work with Coro. Please let me (<>) know where else this is of use so I can add tests and add a mention.

All LWP features and configuration options should still be available when using this module.



Please report any bugs or feature requests to bug-LWP-Protocol-AnyEvent-http at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc LWP::Protocol::AnyEvent::http

You can also look for information at:


Eric Brine, <>

Max Maischein, <>

Graham Barr, <>


No rights reserved.

The author has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.

Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author.

syntax highlighting: