-
-
Save tempire/6225765 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Data::Dumper; | |
my $e = Event->new; | |
$e->on( | |
what => sub { | |
my $ua = Mojo::UserAgent->new; | |
$ua->get('http://127.0.0.1:3001' => sub { warn 55 }); | |
warn 33; | |
} | |
); | |
$e->emit('what'); | |
warn 44; | |
package Event; | |
use Mojo::Base 'Mojo::EventEmitter'; | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment