Update _worker_runtime_host_servicer.py (#557)

Updated _process_request to add to _pending_requests waiting for a response from the target, rather than the source of the request.
This commit is contained in:
Taylor Rockey
2024-09-18 11:19:17 -07:00
committed by GitHub
parent 4998ab5398
commit a479a5e692

View File

@@ -135,9 +135,9 @@ class WorkerAgentRuntimeHostServicer(agent_worker_pb2_grpc.AgentRpcServicer):
return
await target_send_queue.put(agent_worker_pb2.Message(request=request))
# Create a future to wait for the response.
# Create a future to wait for the response from the target.
future = asyncio.get_event_loop().create_future()
self._pending_requests.setdefault(client_id, {})[request.request_id] = future
self._pending_requests.setdefault(target_client_id, {})[request.request_id] = future
# Create a task to wait for the response and send it back to the client.
send_response_task = asyncio.create_task(self._wait_and_send_response(future, client_id))