-
Type: New Feature
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.0.1
-
Component/s: None
-
Fully Compatible
It will be useful to have a simple and cheap way to check if a Connection object can still see any of the MongoDB nodes. By cheap I mean without actually doing any requests, just checking if any of the sockets is still open would be good enough.
An example implementation:
class Connection(common.BaseObject):
def alive(self):
try:
if self.__socket() != None:
return True
except Exception:
pass
return False