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


Python Service.stopService方法代码示例

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


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

示例1: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     """
     Stop the service by calling stored function
     """
     Service.stopService(self)
     if self._stop:
         return self._stop()
开发者ID:meker12,项目名称:otter,代码行数:9,代码来源:api.py

示例2: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     """
     Stop service by stopping the timerservice and disconnecting cass client
     """
     Service.stopService(self)
     d = self._service.stopService()
     return d.addCallback(lambda _: self._client.disconnect())
开发者ID:dragorosson,项目名称:otter,代码行数:9,代码来源:metrics.py

示例3: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
	def stopService(self):
		if self.running:
			Service.stopService(self)
			log.info("Stopping master heartbeat service...")
			return self._hb.stop()
		else:
			return defer.succeed(None)
开发者ID:nagius,项目名称:cxm,代码行数:9,代码来源:heartbeats.py

示例4: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     Service.stopService(self)
     try:
         self.app.close()
     except Exception:
         logger.error('Error while closing application', exc_info=True)
     self._close_database()
开发者ID:Eyepea,项目名称:xivo-skaro,代码行数:9,代码来源:main.py

示例5: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     try:
         file_cache_idxs = MetricCache.getAllFileCaches()
         writeCachedDataPointsWhenStop(file_cache_idxs)
     except Exception as e:
         log.err('write error when stopping service: %s' % e)
     Service.stopService(self)
开发者ID:douban,项目名称:Kenshin,代码行数:9,代码来源:writer.py

示例6: s2

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
		def s2(code, self=self):
			try:
				if code != 1:
					# Cancel stop
					return

				if not (self._state == 'stopping' and (self._process + self._workers) == 0):
					err(RuntimeError('{0} stop error: state-{1} p{2} w{3}'.format(
						self.name,
						self._state,
						self._process,
						self._workers,
					)))

				self._stopCall = None
				self._stopDeferred = None

				# Inside
				Service.stopService(self)

				self._state = 'stopped'

				# Show info
				msg(self.name, 'stopped', system='-')
			except:
				err()
开发者ID:p0is0n,项目名称:mail-services,代码行数:28,代码来源:garbage.py

示例7: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     print 'Stop PullRequest service: %s ...' % self.context.name
     Service.stopService(self)
     if self.watchLoop:
         self.watchLoop.stop()
     if self.schedulerLoop:
         self.schedulerLoop.stop()
开发者ID:alalek,项目名称:common-pullrequest-plugin,代码行数:9,代码来源:service.py

示例8: main

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
    def main(self):
        """Parse arguments and run the script's main function via ``react``."""
        # If e.g. --version is called this may throw a SystemExit, so we
        # always do this first before any side-effecty code is run:
        options = self._parse_options(self.sys_module.argv[1:])

        if self.logging:
            log_writer = eliot_logging_service(
                options.eliot_destination, self._reactor, True
            )
        else:
            log_writer = Service()
        log_writer.startService()

        # XXX: We shouldn't be using this private _reactor API. See
        # https://twistedmatrix.com/trac/ticket/6200 and
        # https://twistedmatrix.com/trac/ticket/7527
        def run_and_log(reactor):
            d = maybeDeferred(self.script.main, reactor, options)

            def got_error(failure):
                if not failure.check(SystemExit):
                    err(failure)
                return failure
            d.addErrback(got_error)
            return d
        try:
            self._react(run_and_log, [], _reactor=self._reactor)
        finally:
            log_writer.stopService()
开发者ID:sysuwbs,项目名称:flocker,代码行数:32,代码来源:script.py

示例9: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     ntasks = len(self._tasks)
     for task in self.iterTasks():
         task.close()
     self._tasks = set()
     Service.stopService(self)
     logger.debug("stopped scheduler (%i tasks killed)" % ntasks)
开发者ID:msfrank,项目名称:terane,代码行数:9,代码来源:sched.py

示例10: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     """
     Stops the loop that fetches mail.
     """
     if self._loop and self._loop.running is True:
         self._loop.stop()
         self._loop = None
     Service.stopService(self)
开发者ID:Meistache,项目名称:leap_mail,代码行数:10,代码来源:service.py

示例11: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     Service.stopService(self)
     if self.__ws_port_obj is None:
         raise Exception('Not started, cannot stop')
     # TODO: Does Twisted already have something to bundle up a bunch of ports for shutdown?
     return defer.DeferredList([
         self.__http_port_obj.stopListening(),
         self.__ws_port_obj.stopListening()])
开发者ID:bitglue,项目名称:shinysdr,代码行数:10,代码来源:app.py

示例12: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     Service.stopService(self)
     self.ready = False
     self._registered = False
     for d in list(self._waiting):
         d.cancel()
     self._waiting = []
     return self._timer_service.stopService()
开发者ID:mithrandi,项目名称:txacme,代码行数:10,代码来源:service.py

示例13: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
    def stopService(self, stopReactor=False):
        Service.stopService(self)
        if self.pipeline is not None:
            self.forceEos()
        else:
            self.shutdown(EXIT_OK, stopReactor)

        return self.shutdownDeferred
开发者ID:alessandrod,项目名称:gstdump,代码行数:10,代码来源:gstdump.py

示例14: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     "Stop reading from the stream."
     ret = None
     if self._streamDone is not None:
         self._streamDone.cancel()
         ret = self._streamDone
         self._streamDone = None
     Service.stopService(self)
     return ret
开发者ID:habnabit,项目名称:twircd,代码行数:11,代码来源:twits.py

示例15: stopService

# 需要导入模块: from twisted.application.service import Service [as 别名]
# 或者: from twisted.application.service.Service import stopService [as 别名]
 def stopService(self):
     """Stop All Janitizer Service"""
     try:
         if self.GARBAGE_CHECK.running:
             self.GARBAGE_CHECK.stop()
         if self.ELDERLY_CHECK.running:
             self.ELDERLY_CHECK.stop()
     except: pass
     Service.stopService(self)
开发者ID:DroneD,项目名称:droned,代码行数:11,代码来源:janitizer.py


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