-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[wip] streaming uploads #6161
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
base: main
Are you sure you want to change the base?
[wip] streaming uploads #6161
Conversation
07807cd
to
238a77f
Compare
self.dataToWrite = .none | ||
inputStream.close() | ||
} else { | ||
let bytesWritten = self.outputStream.write(buffer, maxLength: bytesRead) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens with the bytes that didn't get written? (i.e. bytesWritten < bytesRead
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch. is there a way to move the reader index back? otherwise I can buffer them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you can't unread. You'll need to buffer them and you'll need to stop reading until you're done with the previous writes.
} | ||
completionHandler(task.inputStream) | ||
// FIXME: serious hack here | ||
RunLoop.current.run(until: Date(timeIntervalSinceNow: 10000.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weissi any ideas on why the stream is not going notified unless I run the .current runloop manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that almost certainly means that you're blocking the runloop somewhere.
17c41bc
to
04c0c7b
Compare
motivation: improve upload to stream the content of the files instead of loading them to memory changes: * introduce new upload requiest type * implement stream upload hanlding with URLSession * implement an upload stream provider for registry publishing TODO: * add tests
04c0c7b
to
e896adf
Compare
motivation: improve upload to stream the content of the files instead of loading them to memory
changes:
TODO: