def _send_recv(self, message): (my_end, other_end) = multiprocessing.Pipe() message['to'] = 'output' message['reply_to'] = pickle_connection(other_end) self.process_message(message) my_end.poll(None) return my_end.recv()
def handle_request(self, request): """Handle request by sending it to the MPD frontend.""" if not self.authenticated: (self.authenticated, response) = self.check_password(request) if response is not None: self.send_response(response) return my_end, other_end = multiprocessing.Pipe() self.core_queue.put({ 'to': 'frontend', 'command': 'mpd_request', 'request': request, 'reply_to': pickle_connection(other_end), }) my_end.poll(None) response = my_end.recv() if response is not None: self.handle_response(response)