Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MetaCPAN now always wants to use HTTPS
  • Loading branch information
kraih committed Oct 26, 2017
1 parent 359e455 commit 2f5ee3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -1308,8 +1308,8 @@ synchronize multiple non-blocking requests.
say $mojo->result->dom->at('title')->text;
say $minion->result->dom->at('title')->text;
});
$ua->get('http://metacpan.org/search?q=mojo' => $delay->begin);
$ua->get('http://metacpan.org/search?q=minion' => $delay->begin);
$ua->get('https://metacpan.org/search?q=mojo' => $delay->begin);
$ua->get('https://metacpan.org/search?q=minion' => $delay->begin);
$delay->wait;

If you plan on doing this a lot it might be worth wrapping your
Expand All @@ -1328,12 +1328,12 @@ continuation-passing style APIs into promises, to make them easily composable.
});
return $promise;
}
my $mojo = get('http://metacpan.org/search?q=mojo');
my $minion = get('http://metacpan.org/search?q=minion');
my $mojo = get('https://metacpan.org/search?q=mojo');
my $minion = get('https://metacpan.org/search?q=minion');
$mojo->all($minion)->then(sub {
my ($mojo, $minion) = @_;
say $mojo->result->dom->at('title')->text;
say $minion->result->dom->at('title')->text;
say $mojo->[0]->result->dom->at('title')->text;
say $minion->[0]->result->dom->at('title')->text;
})->wait;

The call to L<Mojo::IOLoop::Delay/"wait"> makes this code portable, it can now
Expand Down

0 comments on commit 2f5ee3d

Please sign in to comment.