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

Streaming tickets #68

Open
wavexx opened this issue Nov 10, 2017 · 0 comments
Open

Streaming tickets #68

wavexx opened this issue Nov 10, 2017 · 0 comments

Comments

@wavexx
Copy link
Member

wavexx commented Nov 10, 2017

After #45 is implemented, we could allocate the Ticket ID immediately and enable background uploads with simultaneous/streaming download.

It would work as follows: if an upload session is allocated, instead of converting it to a path into the final storage location, just create the ticket ID with a pointer to upload ID. The client will continue to send chunks in the background until all chunks are completed. We keep an updated record of the last available byte for each chunk received.

When sending a ticket, and an upload id is available, we read/stream until EOF and simply pause the reader until another chunk is available. We might need to set SO_KEEPALIVE explicitly somehow to avoid drops while waiting for chunks.

Once all chunks are completed, we internally finish the upgrade to a regular ticket by swapping the upload id to a file path. Doing so should be transparent to current readers.

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

1 participant