(self)
Start monitoring, or restart after a fork.

        No effect if called multiple times.

        .. warning:: Topology is shared among multiple threads and is protected
          by mutual exclusion. Using Topology from a process other than the one
          that initialized it will emit a warning and may result in deadlock. To
          prevent this from happening, MongoClient must be created after any
          forking OR MongoClient must be started with connect=False.
Start monitoring, or restart after a fork.
Start monitoring or restart after a fork .
def open(self):
        """Start monitoring, or restart after a fork.

        No effect if called multiple times.

        .. warning:: Topology is shared among multiple threads and is protected
          by mutual exclusion. Using Topology from a process other than the one
          that initialized it will emit a warning and may result in deadlock. To
          prevent this from happening, MongoClient must be created after any
          forking OR MongoClient must be started with connect=False.

        """
        if self._pid is None:
            self._pid = os.getpid()
        else:
            if os.getpid() != self._pid:
                warnings.warn(
                    "MongoClient opened before fork. Create MongoClient "
                    "with connect=False, or create client after forking. "
                    "See PyMongo's documentation for details: http://api."
                    "mongodb.org/python/current/faq.html#pymongo-fork-safe>")

        with self._lock:
            self._ensure_opened()
def open ( self ) : if self . _pid is None : self . _pid = os . getpid ( ) else : if os . getpid ( ) != self . _pid : warnings . warn ( "MongoClient opened before fork. Create MongoClient " "with connect=False, or create client after forking. " "See PyMongo's documentation for details: http://api." "mongodb.org/python/current/faq.html#pymongo-fork-safe>" ) with self . _lock : self . _ensure_opened ( )