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

Slice stream function for node backend #103

Open
3 tasks
risenW opened this issue Nov 3, 2020 · 5 comments
Open
3 tasks

Slice stream function for node backend #103

risenW opened this issue Nov 3, 2020 · 5 comments
Assignees

Comments

@risenW
Copy link
Member

risenW commented Nov 3, 2020

Acceptance Criteria

  • The method should receive start position, end position
  • I am able to seek a file to a specific location and then read N bytes from it
  • I am able to return seek position as a stream
@shevron
Copy link
Collaborator

shevron commented Nov 5, 2020

If we are using the browser's File API, at least for browser this is not needed because File.slice() is already available and does the job.

I am not sure about Node support, but if we want to have node support, we need to provide some kind of unified API - maybe the best approach would be to use something like this that emulates File API on Node.

@risenW
Copy link
Member Author

risenW commented Nov 5, 2020

If we are using the browser's File API, at least for browser this is not needed because File.slice() is already available and does the job.

I am not sure about Node support, but if we want to have node support, we need to provide some kind of unified API - maybe the best approach would be to use something like this that emulates File API on Node.

I don't think this is a priority at the moment, right?

@risenW risenW changed the title Slice stream function that supports seek position Slice stream function for node backend Nov 5, 2020
@rufuspollock
Copy link
Contributor

Node support should be quite straightforward since we have a simple stream API (right?).

@rufuspollock
Copy link
Contributor

rufuspollock commented Nov 9, 2020

@risenW I'm not yet clear why we need slice vs basic stream() method we already had (node streams allow one to read chunk by chunk). Can you give more info on slice vs stream and why we need slice?

@risenW
Copy link
Member Author

risenW commented Nov 9, 2020

@risenW I'm not yet clear why we need slice vs basic stream() method we already had (node streams allow one to read chunk by chunk). Can you give more info on slice vs stream and why we need slice?

This is not needed anymore I think. It was a backup in case the streaming upload didn't work. But since it has already been fixed, we do not need this anymore.

And yes, after my research as well I found out that node file stream has a start and end parameter that we can use.
If needed, we can just create a simple function on top of it.

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

4 participants