Simple way to check if a Connection is still alive.

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Minor - P4
    • 2.4
    • Affects Version/s: 2.0.1
    • Component/s: None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      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

              Assignee:
              A. Jesse Jiryu Davis
              Reporter:
              unbeknownst
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: