Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub timed {
- my $cb = pop;
- my ($self, $url) = @_;
- my $is_done;
- my $done = sub {
- return if $is_done;
- $is_done = 1;
- $cb->(@_);
- };
- Mojo::IOLoop->timer($self->timeout, sub { $done->(Mojo::Transaction::HTTP->new) });
- $self->ua->get($url, $done);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement