当前位置: 首页>>代码示例>>Python>>正文


Python ServerFactory.doStop方法代码示例

本文整理汇总了Python中twisted.internet.protocol.ServerFactory.doStop方法的典型用法代码示例。如果您正苦于以下问题:Python ServerFactory.doStop方法的具体用法?Python ServerFactory.doStop怎么用?Python ServerFactory.doStop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.internet.protocol.ServerFactory的用法示例。


在下文中一共展示了ServerFactory.doStop方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doStop

# 需要导入模块: from twisted.internet.protocol import ServerFactory [as 别名]
# 或者: from twisted.internet.protocol.ServerFactory import doStop [as 别名]
    def doStop(self, cv=None):
        """
        Stops imap service (fetcher, factory and port).

        :param cv: A condition variable to which we can signal when imap
                   indeed stops.
        :type cv: threading.Condition
        :return: a Deferred that stops and flushes the in memory store data to
                 disk in another thread.
        :rtype: Deferred
        """
        if DO_PROFILE:
            log.msg("Stopping PROFILING")
            pr.disable()
            pr.dump_stats(PROFILE_DAT)

        ServerFactory.doStop(self)

        if cv is not None:
            def _stop_imap_cb():
                logger.debug('Stopping in memory store.')
                self._memstore.stop_and_flush()
                while not self._memstore.producer.is_queue_empty():
                    logger.debug('Waiting for queue to be empty.')
                    # TODO use a gatherResults over the new/dirty
                    # deferred list,
                    # as in memorystore's expunge() method.
                    time.sleep(1)
                # notify that service has stopped
                logger.debug('Notifying that service has stopped.')
                cv.acquire()
                cv.notify()
                cv.release()

            return threads.deferToThread(_stop_imap_cb)
开发者ID:bwagnerr,项目名称:leap_mail,代码行数:37,代码来源:imap.py

示例2: doStop

# 需要导入模块: from twisted.internet.protocol import ServerFactory [as 别名]
# 或者: from twisted.internet.protocol.ServerFactory import doStop [as 别名]
    def doStop(self):
        """
        Stops imap service (fetcher, factory and port).
        """
        # mark account as unusable, so any imap command will fail
        # with unauth state.
        self.theAccount.end_session()

        # TODO should wait for all the pending deferreds,
        # the twisted way!
        if DO_PROFILE:
            log.msg("Stopping PROFILING")
            pr.disable()
            pr.dump_stats(PROFILE_DAT)

        return ServerFactory.doStop(self)
开发者ID:Moscarda,项目名称:leap_mail,代码行数:18,代码来源:imap.py

示例3: doStop

# 需要导入模块: from twisted.internet.protocol import ServerFactory [as 别名]
# 或者: from twisted.internet.protocol.ServerFactory import doStop [as 别名]
 def doStop(self):
     """
     Stops imap service (fetcher, factory and port).
     """
     return ServerFactory.doStop(self)
开发者ID:leapcode,项目名称:leap_mail,代码行数:7,代码来源:imap.py

示例4: doStop

# 需要导入模块: from twisted.internet.protocol import ServerFactory [as 别名]
# 或者: from twisted.internet.protocol.ServerFactory import doStop [as 别名]
	def doStop(self):
		debug( "Stopping factory." )
		ServerFactory.doStop(self)
开发者ID:cahirwpz,项目名称:tpserver-py,代码行数:5,代码来源:server.py

示例5: doStop

# 需要导入模块: from twisted.internet.protocol import ServerFactory [as 别名]
# 或者: from twisted.internet.protocol.ServerFactory import doStop [as 别名]
 def doStop(self):
     self.wrappedFactory.doStop()
     ServerFactory.doStop(self)
开发者ID:BillTheBest,项目名称:xmppserver,代码行数:5,代码来源:compression.py


注:本文中的twisted.internet.protocol.ServerFactory.doStop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。