def __init__(self, process_id, component_code, sender=None): self.__reply_queue = hap.MultiprocessingQueue() self.__dispatch_queue = None self.__process_id = process_id self.__component_code = component_code self.__ms_info = None self.reset() self.__timeout_sec = 30 self.__sender = sender
def setup(self, transporter_args): """ This method is bottom half of the constructor and should be called once after the instance is created. Raising exceptions is allowed in this method. """ self.__sender = Sender(transporter_args) HapiProcessor.set_sender(self, self.__sender) self.__rpc_queue = hap.MultiprocessingQueue() # launch dispatcher process self.__dispatcher = Dispatcher(self.__rpc_queue) self.__dispatcher.attach_destination(self.get_reply_queue(), "Main") dispatch_queue = self.__dispatcher.get_dispatch_queue() self.set_dispatch_queue(dispatch_queue) # launch receiver process self.__receiver = Receiver(transporter_args, dispatch_queue, self.__implemented_procedures)
def __init__(self): Callback.__init__(self) self.__q = hap.MultiprocessingQueue()