def response_callback(self, payload): response = json.loads(payload["data"]) if response["status"] != "ready": raise D3ARedisException( f"{self.area.name} received an incorrect response from Redis: {response}" ) if "transaction_uuid" not in response: raise D3ARedisException( f"{self.area.name} received market response without transaction id: {response}" ) self.event_response_uuids.append(response["transaction_uuid"])
def response_callback(self, payload): data = json.loads(payload["data"]) if "response" in data: event_type = data["response"] if event_type in self.str_area_events: self.redis.resume() else: raise D3ARedisException( "RedisAreaDispatcher: Should never reach this point")
def response_callback(self, payload): data = json.loads(payload["data"]) if "response" in data: event_type = data["response"] event_type_id = data["event_type"] if event_type not in self.str_market_events: raise D3ARedisException( "AreaRedisMarketEventDispatcher: Should never reach this point") else: self.child_response_events[event_type_id].set()
def _delete_offer_response(self, payload): data = json.loads(payload["data"]) # TODO: is this additional parsing needed? if isinstance(data, str): data = json.loads(data) if data["status"] == "ready": self.event_response_uuids.append(data["transaction_uuid"]) else: raise D3ARedisException( f"Error when receiving response on channel {payload['channel']}:: " f"{data['exception']}: {data['error_message']}")