Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC over events #4414

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
remove handled rpc
jackgerrits committed Dec 1, 2024
commit f7a6d481c7489867717d1e73952dd5aae9a1ed56
Original file line number Diff line number Diff line change
@@ -128,13 +128,14 @@ async def on_message(self, message: Any, ctx: MessageContext) -> None:
if ctx.topic_id is not None and (request_id := is_rpc_response(ctx.topic_id.type)) is not None:
if request_id in self._pending_rpc_requests:
self._pending_rpc_requests[request_id].set_result(message)
del self._pending_rpc_requests[request_id]
elif self._forward_unbound_rpc_responses_to_handler:
await self.on_message_impl(message, ctx)
else:
warnings.warn(f"Received RPC response for unknown request {request_id}. To forward unbound rpc responses to the handler, set forward_unbound_rpc_responses_to_handler=True", stacklevel=2)
return None

return await self.on_message_impl(message, ctx)
await self.on_message_impl(message, ctx)

async def send_message(
self,