the _active is not kept up to date, if the connection is dropped for some reason. I know _active is a 'hidden' variable, but I would like it to be kept up to date anyway.
This is a very simple fix:
time.sleep(self.SLEEP_INTERVAL) # to reduce contention
except Exception, e:
self._active = False
This just sets _active to False, if there is any exceptions. Perhaps really we should compare the exceptions, because who knows what all the possible exceptions may be, but I would think for most exceptions that might happen, the connection will fall apart in the process of raising the exception.
Personally I'd love to see _active set to just active, and allow code to see it appropriately.
Oops, I patched the wrong line. Will fix later
closes #89 again