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

Restructure RPC #4322

Open
jackgerrits opened this issue Nov 22, 2024 · 0 comments
Open

Restructure RPC #4322

jackgerrits opened this issue Nov 22, 2024 · 0 comments
Assignees
Milestone

Comments

@jackgerrits
Copy link
Member

jackgerrits commented Nov 22, 2024

RPC can be built as a client side concept entirely to greatly simplify the runtime.

  • send_message can be removed from AgentRuntime
  • BaseAgent.send_message should be renamed to send_rpc - its semantics remain identical
  • Remove RPC code from runtime impl, protos, etc

Procedure for an RPC is as follows:

  1. Request ID (a uuid) is generated as request_id
  2. Topic ID to be sent to is generated as recipient_agent_id.type and potentially some extra distinguishing info request_topic_id
  3. Topic ID to be received from is generated as a well known format that contains the recipient_agent_id.type and request_id as response_topic_id
  4. An empty Future is generated
  5. Explicit subscription is generated for topic_id which does two things: sets the future to the received message, removes the subscription
  6. Event is published to request_topic_id with request_id
  7. Future is returned from the function for the consumer to await

Note:

  • I think we should potentially make the per agent implicit rpc subscription a bit more specific to avoid surprising behavior of agents receiving publishes without manually adding a subscription
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants