Skip to content

Instantly share code, notes, and snippets.

@earino
Created July 6, 2012 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earino/3061120 to your computer and use it in GitHub Desktop.
Save earino/3061120 to your computer and use it in GitHub Desktop.
The standard way folks handle reconnection
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