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.

"""
from .client import Bot

_run_cli(Bot, hooks, argv, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't know if it is actually unused e.g. for rpc_server_path, at least the documentation should be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rpc_server_path was recently introduced. we can re-introduce **kwargs here if actually needed. Passing **kwargs all around makes reasoning about what happens harder in my experience.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the reason **kwargs existed in the past was to be able to control the created process, ex. IIRC TUI clients need to tweak it so stderr don't dirty the screen,

I am talking about the removal in the Rpc class, but other approaches like allowing to pass a Popen directly to the start method in RpcProcess would also work I guess

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.

4 participants