-
Notifications
You must be signed in to change notification settings - Fork 645
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
File: TAR archive reader #2268
File: TAR archive reader #2268
Conversation
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.
Always pretty hard to see if all the pulling/pushing aligns neatly, but looks good AFAICS. The low-level tar logic remained pretty neat.
@@ -27,4 +27,10 @@ object Archive { | |||
def tar(): Flow[(TarArchiveMetadata, Source[ByteString, _]), ByteString, NotUsed] = | |||
TarArchiveManager.tarFlow() | |||
|
|||
/** | |||
* Parse incoming `ByteString`s into tar file entries and sources for the file contents. | |||
* The file contents sources MUST be consumed to progress reading the file. |
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.
Hmm, this is kinda dangerous - uses like bytes.via(tarReader).take(100).foreach(_.runWith(Sink.ignore))
could stall the stream.
I seem to remember we have similar problems in processing multipart file uploads in Akka HTTP, but can't find a reference right now.
I don't see how we could make an API that avoids this, though, so perhaps this comment is sufficient.
Hey @ennru, given your work on this pull request here, any chance you also add a ZIP archive reader? |
I have no plans for that at the moment. |
Add reading of tar-formatted streams of
ByteString
s.Inspired by the recent addition of writing tar in #2241 by @choffmeister.
TarReaderStage
TarArchiveEntry
ByteString
handling inTarArchiveEntry
header creationTODO
SubSourceOutlet