x0b / rcx

Rclone for Android
https://x0b.github.io
GNU General Public License v3.0
1.67k stars 143 forks source link

maintenance: rclone as shared library #130

Open x0b opened 3 years ago

x0b commented 3 years ago

TLDR: I intend to move RCX from the current process based model when controlling rclone towards an in-process shared library model.

When RCX was initially conceived as rcloneExplorer, the only way to control rclone was by using the command line interface. Since then, rclone has grown in features, among them an remote control (RC) interface to invoke most rclone actions. Since this is a purpose-build interface for inter-process communication, the semantics and data formats are much better defined. Using the RC interface also avoids the overhead of having to spawn a new rclone process for each an every action.

The new interface is already built and is used e.g. in #8 (VCP). However, it currently comes with the significant disadvantage of using a TCP/IP transport, which introduces overhead and new failure modes. It also requires workarounds around the Android app lifecycle model, which you see by the requirement of the background service notification in v1.12.

The next step will be to load rclone directly as a shared library. Experiments towards this goal have been underway for the last two years, but recent changes in rclone, go and our tooling have made that goal much more achievable than before. A minimal demo app built with this mode is already running.

There are a few big tasks still remaining until we reach this goal:

There is also lots of work to do on the RCX side - while the RC interface is mostly ready, we need to migrate all the old parts of the app to using the new parts of the app. We also need to find ways to deal with the resulting changes towards the rclone execution and lifecycle.

Other related issues:

ncw commented 3 years ago

Note that the work integrating rclone as a library has this issue https://github.com/rclone/rclone/issues/4891

x0b commented 3 years ago

Yes, the first prototype this year was based on https://github.com/rclone/rclone/issues/4891#issuecomment-786587698 modified for gomobile.