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

Run rust in a different process #2523

Open
TaeHagen opened this issue Jan 31, 2025 · 1 comment
Open

Run rust in a different process #2523

TaeHagen opened this issue Jan 31, 2025 · 1 comment
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request

Comments

@TaeHagen
Copy link

Is your feature request related to a problem? Please describe.
No. This is more of a "how would I do this?" question. I'm the author of a chat app (OpenBubbles, on play store) and use FRB to communicate with a rust daemon in the background (must be always-alive for a direct connection with iMessage). The flutter frontend is fairly heavy, and, as a result, it would be nice to put the frontend in a different process as the backend, so the lightweight, efficient backend can stay alive whilst the heavy, memory-intensive flutter UI can be killed by the OS. I would ideally like to be able to FFI call rust code as normal, but also shove the requests across processes/a service connection (Binder/IPC)

Describe the solution you'd like
I don't know. I'm fine with writing some manual glue code as I know this is not a use case you would commonly support. I know you already serialize everything for FFI, so it would be amazing if I could just take those packets and shove them over IPC/Binder instead.

Describe alternatives you've considered
Currently everything happens in process, normally everything just gets killed and then the daemon alone restarts. It works, but it's not ideal, and, in rare cases, can lead to missed messages.

@TaeHagen TaeHagen added the enhancement New feature or request label Jan 31, 2025
@fzyzcjy
Copy link
Owner

fzyzcjy commented Jan 31, 2025

First thing in my mind: What about flutter call rust in the same process, and then rust call rust-in-another-process?

Secondly, yes the proposal looks pretty reasonable, and thus feel free to PR for this!

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants