Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ async def send_message(
parent=None,
extraAttributes={"message_type": type(message).__name__},
):
future = asyncio.get_event_loop().create_future()
future = asyncio.get_running_loop().create_future()
if recipient.type not in self._known_agent_names:
future.set_exception(Exception("Recipient not found"))
return await future
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ async def send_message(
"create", recipient, parent=None, extraAttributes={"message_type": data_type}
):
# create a new future for the result
future = asyncio.get_event_loop().create_future()
future = asyncio.get_running_loop().create_future()
request_id = await self._get_new_request_id()
self._pending_requests[request_id] = future
serialized_message = self._serialization_registry.serialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def _process_request(self, request: agent_worker_pb2.RpcRequest, client_id
await target_send_queue.send(agent_worker_pb2.Message(request=request))

# Create a future to wait for the response from the target.
future = asyncio.get_event_loop().create_future()
future = asyncio.get_running_loop().create_future()
self._pending_responses.setdefault(target_client_id, {})[request.request_id] = future

# Create a task to wait for the response and send it back to the client.
Expand Down