-
Notifications
You must be signed in to change notification settings - Fork 712
Introduce NIODecodedAsyncSequence for easy decoding of async sequences
#3407
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
Conversation
|
@glbrntt |
|
Also cc @Lukasa. Since the PR is in "draft" mode it doesn't ping maintainers for reviews, so I thought I can do it manually. |
2ab34fe to
5ca14cb
Compare
5ca14cb to
c0725a7
Compare
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.
The overall shape looks good! I left a few high-level comments inline.
|
Checklist of the remaining things:
I'll request a review when these are done. |
07ce418 to
9d40dbc
Compare
9d40dbc to
a8cc593
Compare
9f88b1b to
0d8cbc2
Compare
08a664d to
758008b
Compare
|
@glbrntt The PR should be ready. I'm open to better namings or more test ideas or nit picks etc... |
758008b to
ac20efe
Compare
b32d4f2 to
0b9b8f7
Compare
0b9b8f7 to
d82a9c1
Compare
0be9c92 to
3fae340
Compare
NIODecodedAsyncSequence + NIOSplitMessageDecoder to decode ByteBuffers and split contentNIODecodedAsyncSequence for easy decoding of async sequences
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.
This is looking a lot better!
f6618d8 to
9430c32
Compare
9430c32 to
996798a
Compare
|
@glbrntt should be good to go assuming I've satisfied the docs soundness CI. |
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.
LGTM, thanks @MahdiBM!
Previous PR: #3405
Add an API on top of
AsyncSequence<ByteBuffer>which can dynamically decode values.Add an API on top of the newAsyncSequence<ByteBuffer>APIs which splits the file based on its content.Motivation:
Provides a nice API to decode files, instead of users having to go though manually handling
BufferedReader.read(while:).I struggled with this, as documented in https://swift-open-source.slack.com/archives/C9MMT6VGB/p1760115481607159
Modifications:
Add
NIODecodedAsyncSequence+ functions onAsyncSequence<ByteBuffer>to create such a sequence.AddNIOSplitMessageDecoder+ stdlib-like functions onAsyncSequence<ByteBuffer>to create such a sequence.Result:
Users can decode an async sequence of
ByteBuffers easier.Users can easily split files based on their content.Checklist
See this comment for a checklist of the remaining things to do: #3407 (comment)