def test_makes_events_as_properties(self): events = [ factory.make_name("event") for _ in range(3) ] group = EventGroup(*events) for event in events: self.expectThat(getattr(group, event), IsInstance(Event))
def __init__(self, ipcWorker): super().__init__() self.ipcWorker = ipcWorker self.endpoints = [[ TCP6ServerEndpoint(reactor, port) for port in range(5250, 5260) ]] self.connections = defaultdict(set) self.connectionsCache = defaultdict(dict) self.waiters = defaultdict(set) self.factory = Factory.forProtocol(RegionServer) self.factory.service = self self.ports = [] self.events = EventGroup("connected", "disconnected")
def __init__(self, alias="default"): self.alias = alias self.listeners = defaultdict(list) self.autoReconnect = False self.connection = None self.connectionFileno = None self.notifications = set() self.notifier = task.LoopingCall(self.handleNotifies) self.notifierDone = None self.connecting = None self.disconnecting = None self.registeredChannels = False self.log = Logger(__name__, self) self.events = EventGroup("connected", "disconnected")
def __init__(self, alias="default"): self.alias = alias self.listeners = defaultdict(list) self.autoReconnect = False self.connection = None self.connectionFileno = None self.notifications = set() self.notifier = task.LoopingCall(self.handleNotifies) self.notifierDone = None self.connecting = None self.disconnecting = None self.registeredChannels = set() self.channelRegistrar = task.LoopingCall( lambda: ensureDeferred(self.registerChannels())) self.channelRegistrarDone = None self.log = Logger(__name__, self) self.events = EventGroup("connected", "disconnected") # the connection object isn't threadsafe, so we need to lock in order # to use it in different threads self._db_lock = threading.RLock()