def __init__(self): # Import gevent here because connectors may not want to use it import gevent from gevent.lock import RLock self._gevent = gevent self._RLock = RLock self.sessions = {} self.lock = self._RLock() self.keep_connecting = set() # IDs of connections to keep connecting for # Connects us to interesting events the to-be-established connections need to consult dispatcher.listen_for_updates(self.dispatcher_listen_for, self.dispatcher_callback) # Maps broker message IDs to their accompanying config self.dispatcher_backlog = []
def __init__(self): # Import gevent here because connectors may not want to use it import gevent from gevent.lock import RLock self._gevent = gevent self._RLock = RLock self.sessions = {} self.lock = self._RLock() self.keep_connecting = set() # IDs of connections to keep connecting for # Connects us to interesting events the to-be-established connections need to consult dispatcher.listen_for_updates(self.dispatcher_listen_for, self.dispatcher_callback) # Maps broker message IDs to their accompanying config self.dispatcher_backlog = []