code: def notifyReady(self):
          
          if self.instance:
              return defer.succeed(self.instance)
  
          def on_cancel(d):
              self.__notify_ready.remove(d)
  
          df = defer.Deferred(on_cancel)
          self.__notify_ready.append(df)
          return df
docs: Returns a deferred that will fire when the factory has created a
              protocol that can be used to communicate with a Mongo server.
  
              Note that this will not fire until we have connected to a Mongo
              master, unless slaveOk was specified in the Mongo URI connection
              options.