-
Notifications
You must be signed in to change notification settings - Fork 653
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
NIOFileSystem: BufferedReader isn't really composable #3011
Comments
What's the concrete ask here Johannes, a |
Both. a |
I understand your ask here. IMO we should start with providing an I personally feel like a general |
So the initial improvement here could be to provide Would it be useful to make |
I'm not at all sure that we want to add the cost of unicode-correctness. |
As in, support an optional separator arg, but treat it as string, and default to I'll get to this once I get the stuff that's already open merged in. |
Expected behavior
BufferedReader
is probably the best abstraction inNIOFileSystem
to stream a bunch of data. Real world examples include for example JSON lines (JSONL).I'd expect to be able to write
And for more complex schemes that aren't just newlines, I'd like to be able to write something composable on BufferedReader.
Actual behavior
Right now I use
But this is
while true
+guard !seenEOF
(_, _) =
UInt8("\n")
). If I wanted to support\r\n
&\n
, then this would get a lot more messySwiftNIO version/commit hash
2.77.0
FWIW, I also have another thing which allows me to use
but, it's very complex:
The text was updated successfully, but these errors were encountered: