Created
March 24, 2012 16:08
-
-
Save leedo/2184656 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sub cleanup { | |
my $cv = AE::cv; | |
for my $irc ($self->ircs) { | |
$cv->begin; | |
$irc->reg_cb(disconnect => sub { $cv->end }); | |
$irc->disconnect; | |
} | |
for my $plugin ($self->plugins) { | |
$cv->begin; | |
$plugin->shutdown(sub { $cv->end }); | |
} | |
my $t = AE::timer 5, 0, sub { | |
$cv->croak("timeout shutting down plugins"); | |
}; | |
$cv->recv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment