Beispiel #1
0
    def __init__(self, host, port, db_name):
        common.ConnectionManager.__init__(self)
        log.LogProxy.__init__(self, log.FluLogKeeper())
        ChangeListener.__init__(self, self)

        self.semaphore = defer.DeferredSemaphore(1)
        self.paisley = None
        self.db_name = None
        self.host = None
        self.port = None
        self.notifier = None

        self.retry = 0
        self.reconnector = None

        self._configure(host, port, db_name)
Beispiel #2
0
    def __init__(self):
        common.ConnectionManager.__init__(self)
        log.LogProxy.__init__(self, log.FluLogKeeper())
        ChangeListener.__init__(self, self)
        common.Statistics.__init__(self)

        # id -> document
        self._documents = {}
        # id -> view_name -> (key, value)
        self._view_cache = {}

        self._on_connected()

        # document_type -> int, used for generating nice agent IDs in
        # simulations
        self._doc_type_counters = dict()
Beispiel #3
0
 def cancel_listener(self, listener_id):
     ChangeListener.cancel_listener(self, listener_id)
     return self._setup_notifier()
Beispiel #4
0
 def listen_changes(self, doc_ids, callback):
     d = ChangeListener.listen_changes(self, doc_ids, callback)
     d.addCallback(defer.bridge_param, self._setup_notifier)
     return d