Ejemplo n.º 1
0
    def __init__(self,
                 host='127.0.0.1:2181',
                 handler=None,
                 ignore_expire=False):

        if handler == 'gevent':
            import gevent

            kr = KazooRetry(max_tries=-1,
                            delay=0.2,
                            sleep_func=gevent.sleep,
                            ignore_expire=ignore_expire)
            KazooClient.__init__(self,
                                 hosts=host,
                                 connection_retry=kr,
                                 handler=SequentialGeventHandler())
        else:
            kr = KazooRetry(max_tries=-1,
                            delay=0.2,
                            ignore_expire=ignore_expire)
            KazooClient.__init__(
                self,
                hosts=host,
                connection_retry=kr,
            )

        self.start()
        self.add_listener(self._conn_state_listener)
 def __init__(self, hosts='127.0.0.1:2181',
              timeout=10.0, client_id=None, handler=None,
              default_acl=None, auth_data=None, read_only=None,
              randomize_hosts=True, connection_retry=None,
              command_retry=None, logger=None, **kwargs):
     KazooClient.__init__(self, hosts,
                          timeout, client_id, handler,
                          default_acl, auth_data, read_only,
                          randomize_hosts, connection_retry,
                          command_retry, logger, **kwargs)
     self.Counter = partial(CounterLast, self)
Ejemplo n.º 3
0
 def __init__(self, hosts='127.0.0.1:2181',
              timeout=10.0, client_id=None, handler=None,
              default_acl=None, auth_data=None, read_only=None,
              randomize_hosts=True, connection_retry=None,
              command_retry=None, logger=None, **kwargs):
     KazooClient.__init__(self, hosts,
                          timeout, client_id, handler,
                          default_acl, auth_data, read_only,
                          randomize_hosts, connection_retry,
                          command_retry, logger, **kwargs)
     self.Counter = partial(CounterLast, self)
Ejemplo n.º 4
0
 def __init__(self,hosts=ZOO_ADDR):
     KazooClient.__init__(self, hosts=hosts)
     self.start()