Skip to content

Streaming tickets #68

Description

@wavexx

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions