async def _process_results_at_end_gateway( tasks: List[asyncio.Task], request_graph: TopologyGraph) -> asyncio.Future: partial_responses = await asyncio.gather(*tasks) partial_responses, metadatas = zip(*partial_responses) filtered_partial_responses = list( filter(lambda x: x is not None, partial_responses)) response = filtered_partial_responses[0] request_graph.add_routes(response) return response
async def _process_results_at_end_gateway( tasks: List[asyncio.Task], request_graph: TopologyGraph) -> asyncio.Future: if self._executor_endpoint_mapping is None: await asyncio.gather(gather_endpoints(request_graph)) partial_responses = await asyncio.gather(*tasks) partial_responses, metadatas = zip(*partial_responses) filtered_partial_responses = list( filter(lambda x: x is not None, partial_responses)) response = filtered_partial_responses[0] request_graph.add_routes(response) if graph.has_filter_conditions: _sort_response_docs(response) return response