Skip to content

Conversation

@hpk42
Copy link
Contributor

@hpk42 hpk42 commented Nov 28, 2025

also internally refactors rpc.py a bit and strikes unneccessary **kwargs

@hpk42 hpk42 marked this pull request as draft November 28, 2025 18:12
@hpk42 hpk42 force-pushed the hpk/rpc-pipes branch 10 times, most recently from 510fbee to 1ab8329 Compare November 28, 2025 22:15
@hpk42 hpk42 changed the title [wip] play around with Rpc feat: allow to connect a python rpc-client to an rpc-server via a unix FIFO file instead of subprocess Nov 29, 2025
@hpk42 hpk42 marked this pull request as ready for review November 29, 2025 14:50
fn_response_fifo = tmp_path.joinpath("response_fifo")
os.mkfifo(fn_request_fifo)
os.mkfifo(fn_response_fifo)
popen = subprocess.Popen(f"deltachat-rpc-server <{fn_request_fifo} >{fn_response_fifo}", shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For any real use FIFOs should likely be replaced with the UNIX socket, which exists on all platforms (including Windows) and can handle multiple connections.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #7545 for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to rather go for UNIX sockets, but i think it's fine to merge this PR already. Shouldn't be too hard to write another RpcUNIXSocket subclass after #7545 is done.



class RpcFIFO(BaseRpc):
"""RPC client that runs and connects to a deltachat-rpc-server through FIFO files."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""RPC client that runs and connects to a deltachat-rpc-server through FIFO files."""
"""RPC client that connects to a deltachat-rpc-server through FIFO files."""

Copy link
Contributor

@Simon-Laux Simon-Laux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

  • Maybe removal of **kwargs should be mentioned in changelog as API change.
  • we should wait for another approval from someone that knows python better than I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants