Permalink
Browse files

Added reconnect utility method

  • Loading branch information...
1 parent 94d470c commit 3139c8899fff1451459964fd98fe0043681f8ac6 @phobos182 phobos182 committed Oct 5, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 beanstalkc.py
View
@@ -74,6 +74,11 @@ def close(self):
except socket.error:
pass
+ def reconnect(self):
+ """Re-connect to server."""
+ self.close()
+ self.connect()
+
def _interact(self, command, expected_ok, expected_err=[]):
SocketError.wrap(self._socket.sendall, command)
status, results = self._read_response()

0 comments on commit 3139c88

Please sign in to comment.