Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document order in which handlers get applied #273

Closed
oalders opened this issue Nov 23, 2017 · 0 comments
Closed

Document order in which handlers get applied #273

oalders opened this issue Nov 23, 2017 · 0 comments

Comments

@oalders
Copy link
Member

oalders commented Nov 23, 2017

From my testing it appears to be:

request_preprepare
request_prepare
request_send
response_header
response_data
response_done
response_redirect

See:

use strict;
use warnings;
use feature qw( say );

use LWP::UserAgent;
my $ua = LWP::UserAgent->new; 

my @phases = (
    'request_preprepare',
    'request_prepare',
    'request_send',
    'response_header',
    'response_data',
    'response_done',
    'response_redirect',
  );

for my $phase (@phases) {   
    $ua->add_handler( $phase => sub { say "$phase"; return undef; } );
}

$ua->get('https://metacpan.org');
@oalders oalders changed the title Document order that handlers get applied Document order in which handlers get applied Nov 23, 2017
@oalders oalders changed the title Document order in which handlers get applied Document order in which order handlers get applied Nov 23, 2017
@oalders oalders changed the title Document order in which order handlers get applied Document order in which handlers get applied Nov 23, 2017
@genio genio closed this as completed in aded266 Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant