Created
July 6, 2012 16:15
-
-
Save earino/3061120 to your computer and use it in GitHub Desktop.
The standard way folks handle reconnection
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
Disconnected => sub { | |
my ($heap, $kernel) = @_[HEAP, KERNEL]; | |
$heap->{'logger'}->error("disconnected from ".$config{'scanner_host'}.":".$config{'scanner_port'}." enqueueing reconnect."); | |
$kernel->delay( reconnect => 60 ); | |
$backoff->failure(); | |
}, | |
ServerError => sub { | |
my ($heap, $kernel) = @_[HEAP, KERNEL]; | |
$heap->{'logger'}->error("server error from ".$config{'scanner_host'}.":".$config{'scanner_port'}." enqueueing reconnect."); | |
$kernel->delay( reconnect => 60 ); | |
$backoff->failure(); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment