Repository navigation
Support PID alias in the send_msg effect - #653
Conversation
|
I didnβt change the documentation. I wanted to discuss the idea and its implementation first. Iβm implementing a feature in Khepri to allow to send the result of a command to a specific process which may not be the caller (as part of the batching effort). I would like to be able to set a PID alias instead of a PID to make it resistant to log replay: the result should not be sent a second time to that designated process. As noted in a couple comments in the code, itβs impossible to determine the PID or the node of a PID alias. Therefore, the |
b4af6af to
4d07f4d
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
Pull request overview
Adds PID-alias support to send_msg effects, routing alias messages through the leader.
Changes:
- Detects reference-based aliases during effect dispatch.
- Adds an integration test for active alias delivery.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/ra_server_proc.erl |
Dispatches alias-targeted messages from the leader. |
test/ra_machine_int_SUITE.erl |
Tests basic alias delivery. |
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4d07f4d to
189e967
Compare
This is the same as a PID except that the process who created its alias can decide if it is still interested in a reply or not. If the alias is deleted, the message won't reach the process mailbox.
Only the PID was documented as a valid target. It was missing the registered process and the newly added process alias.
189e967 to
5e2b9b6
Compare
This is the same as a PID except that the process who created its alias can decide if it is still interested in a reply or not. If the alias is deleted, the message won't reach the process mailbox.
However, it is not possible to query the PID or its node from an alias. In the context of Ra, it is impossible to implement the
localoption of thesend_msgeffect.Because of this, the message is always sent from the leader.