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


Python TimerService.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, poller=None, step=300):
     """
     """
     if poller is None:
         raise RuntimeError('poller cannot be None')
     if not issubclass(type(poller), IPoll):
         raise TypeError('poller privided is not a subclass of IPoll')
     self._poller = poller
     TimerService.__init__(self, step=step, callable=self._poller.poll)
开发者ID:flihp,项目名称:twobit-git-poller,代码行数:11,代码来源:githuborgrepopollerservice.py

示例2: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, poller=None, step=60*5):
     """ The magic here is calling the TimerService constructor (old
         style class) to set the polling interval and specify the polling
         function.
     """
     if poller is None:
         raise RuntimeError('poller cannot be None')
     if not issubclass(type(poller), IPoll):
         raise TypeError('poller provided is not a subclass of IPoll');
     self._poller = poller
     TimerService.__init__(self, step=step, callable=self._poller.poll)
开发者ID:flihp,项目名称:twobit-git-poller,代码行数:13,代码来源:gitpollerservice.py

示例3: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, all_stations, base_config, base_dir, poll_length, file_pattern,
              send_command, command_helper, complete_command, failed_command):
     TimerService.__init__(self, poll_length, self.run_poll)
     self.log = log
     self.all_stations = all_stations
     self.base_config = dict(base_config)
     self.base_folder = base_dir
     self.file_pattern = file_pattern
     self.send_command = send_command
     self.complete_command = complete_command
     self.failed_command = failed_command
     self.command_helper = command_helper
开发者ID:leesdolphin,项目名称:eventstreamr,代码行数:14,代码来源:queue.py

示例4: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, reactor, interval, k8s, namespace, router):
     TimerService.__init__(
         self,
         interval,
         divert_errors_to_log(self._check_once, u"router-update"),
         k8s,
         namespace,
     )
     # This attribute controls the the reactor used by TimerService to set
     # up the LoopingCall.
     self.clock = reactor
     self._router = router
开发者ID:LeastAuthority,项目名称:leastauthority.com,代码行数:14,代码来源:_router.py

示例5: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
    def __init__(self, batchsize, interval, slv_client, clock=None):
        """
        Initializes the scheduler service with batch size and interval

        :param int batchsize: number of events to fetch on each iteration
        :param int interval: time between each iteration
        :param slv_client: a :class:`silverberg.client.CQLClient` or
                    :class:`silverberg.cluster.RoundRobinCassandraCluster` instance used to get lock
        :param clock: An instance of IReactorTime provider that defaults to reactor if not provided
        """
        from otter.models.cass import LOCK_TABLE_NAME
        self.lock = BasicLock(slv_client, LOCK_TABLE_NAME, 'schedule', max_retry=0)
        TimerService.__init__(self, interval, self.check_for_events, batchsize)
        self.clock = clock
        self.log = otter_log.bind(system='otter.scheduler')
开发者ID:sharwell,项目名称:otter,代码行数:17,代码来源:scheduler.py

示例6: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
    def __init__(self, batchsize, interval, store, kz_client,
                 zk_partition_path, time_boundary, buckets, clock=None, threshold=60):
        """
        Initialize the scheduler service

        :param int batchsize: number of events to fetch on each iteration
        :param int interval: time between each iteration
        :param kz_client: `TxKazooClient` instance
        :param buckets: an iterable containing the buckets which contains scheduled events
        :param zk_partition_path: Partiton path used by kz_client to partition the buckets
        :param time_boundary: Time to wait for partition to become stable
        :param clock: An instance of IReactorTime provider that defaults to reactor if not provided
        """
        TimerService.__init__(self, interval, self.check_events, batchsize)
        self.store = store
        self.clock = clock
        self.kz_client = kz_client
        self.buckets = buckets
        self.zk_partition_path = zk_partition_path
        self.time_boundary = time_boundary
        self.kz_partition = None
        self.threshold = threshold
        self.log = otter_log.bind(system='otter.scheduler')
开发者ID:MariaAbrahms,项目名称:otter,代码行数:25,代码来源:scheduler.py

示例7: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
	def __init__( self, metricProvider ):
		TimerService.__init__( self, metricProvider.getInterval( ), self.processMetrics )
		self.metricProvider = metricProvider
开发者ID:MagmaLabs,项目名称:cloud-agent,代码行数:5,代码来源:MetricService.py

示例8: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self):
     TimerService.__init__(self, 60 * 60, self._report)
开发者ID:alex,项目名称:t-web,代码行数:4,代码来源:pypymemdbg.py

示例9: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
    def __init__(self, step, db, cmd):
        TimerService.__init__(self, step, self.ping)

        self.db = db
        self.cmd = cmd
开发者ID:phrolov,项目名称:justmon,代码行数:7,代码来源:ping.py

示例10: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, interval, api):
     TimerService.__init__(self, interval, api.run_scripts)
开发者ID:jonobacon,项目名称:ubuntu-accomplishments-daemon,代码行数:4,代码来源:service.py

示例11: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, launcher, interval=5):
     self.launcher = launcher
     TimerService.__init__(self, interval, self.heartbeat)
     self.sent_hello = False
     self.netlink = netlink.RoutingNetlink()
开发者ID:pombreda,项目名称:rmake3,代码行数:7,代码来源:launcher.py

示例12: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, announce_protocol):
     self.protocol = announce_protocol
     TimerService.__init__(self, MULTICAST_ANNOUNCE_INTVL, self.announceAndPrune)
开发者ID:geoff-kruss,项目名称:py2pchat,代码行数:5,代码来源:services.py

示例13: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, dispatcher):
     TimerService.__init__(self, 5, self.checkWorkers)
     self.dispatcher = dispatcher
开发者ID:pombreda,项目名称:rmake3,代码行数:5,代码来源:support.py

示例14: __init__

# 需要导入模块: from twisted.application.internet import TimerService [as 别名]
# 或者: from twisted.application.internet.TimerService import __init__ [as 别名]
 def __init__(self, log_path, interval=1):
     self.log_file = None
     self.log_path = log_path
     TimerService.__init__(self, interval, self.do_watch)
开发者ID:nickmerwin,项目名称:il2ds-middleware,代码行数:6,代码来源:service.py


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