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

Feature(API): Allow data streaming for gets #2421

Open
traktion opened this issue Nov 8, 2024 · 1 comment
Open

Feature(API): Allow data streaming for gets #2421

traktion opened this issue Nov 8, 2024 · 1 comment

Comments

@traktion
Copy link

traktion commented Nov 8, 2024

The current client libraries have archive_get and data_get, but both return Bytes. While this is simple to use and fine for small files, it isn't good for larger files.

Can we have an interface which is similar to how file I/O is usually implemented, e.g. something like a file handler, buffer and offset. This would allow app developers to stream data through their app as it is downloaded.

For sn_httpd, this is a fairly fundamental requirement for larger files. Videos, for example, need to be streamed to allow fast viewing and only ever need to buffer a minute or so ahead. The same is true (to a lesser extent) with audio. Holding all of the data in memory is also inefficient - streaming it to the web client and then discarding it, is ideal.

There may be 'a better way' to do it, but following how Rust works with files may be a good place to start.

@happybeing
Copy link
Contributor

We need streaming for both PUT and GET.

If this is to be a storage network this is an important part of the API and I'll need this to support rclone for backup/restore.

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

No branches or pull requests

2 participants