-
-
Notifications
You must be signed in to change notification settings - Fork 117
feat: allow to connect a python rpc-client to an rpc-server via a unix FIFO file instead of subprocess #7535
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
base: main
Are you sure you want to change the base?
Conversation
510fbee to
1ab8329
Compare
| 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #7545 for this.
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """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.""" |
There was a problem hiding this 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
**kwargsshould be mentioned in changelog as API change. - we should wait for another approval from someone that knows python better than I do.
also internally refactors rpc.py a bit and strikes unneccessary
**kwargs