Today, the FFI library is responsible for polling the server for updates. It uses tokio for scheduling an interval based chron & reqwest for performing HTTP requests. The problem with this is that it'll ship these dependencies to foreign language clients adding un-necessary weight to them. To get a tangible number I created a small binary w/ these dependencies, using minimal features & configured the build for size optimizations. Seems to be a little over 1MB. You can check it out here.
But size isn't the only issue, such dependencies can also limit platform support, as you can only ship to platforms supported by these libraries.
Removing tokio as a dependency shouldn't too hard, but reqwest might be a challenge. Maybe one can move to a lighter HTTP client like ureq & see if the size works out, but platform support might still be a challenge.
IMO, polling itself should just be moved out of the FFI library & into the foreign client.
Today, the FFI library is responsible for polling the server for updates. It uses
tokiofor scheduling an interval based chron &reqwestfor performing HTTP requests. The problem with this is that it'll ship these dependencies to foreign language clients adding un-necessary weight to them. To get a tangible number I created a small binary w/ these dependencies, using minimal features & configured the build for size optimizations. Seems to be a little over 1MB. You can check it out here.But size isn't the only issue, such dependencies can also limit platform support, as you can only ship to platforms supported by these libraries.
Removing
tokioas a dependency shouldn't too hard, butreqwestmight be a challenge. Maybe one can move to a lighter HTTP client like ureq & see if the size works out, but platform support might still be a challenge.IMO, polling itself should just be moved out of the FFI library & into the foreign client.