-
Notifications
You must be signed in to change notification settings - Fork 629
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
Add integration with Kotlin IO multiplatform library #253
Comments
Any timeline on this? 2019? End of 2020? |
@StephenOTT As soon as kotlinx-io is ready (currently it is under huge refactoring). |
Great. Thanks. |
… become healthy with Docker 19.03.5. Docker 19.03.5 no longer sends new line characters between events, so we can't use that as a reliable way to read the first event from the event stream. So instead, we have to keep reading characters, one at a time, until we get a valid JSON object. Once Kotlin/kotlinx.serialization#204 (or Kotlin/kotlinx.serialization#253) is implemented, we can make this slightly nicer by just directly decoding from a stream. This resolves #393.
It seems like not much is happening on the kotlinx-io repository. Is the plan still to support the use-cases linked to by this issue (e.g. (de)serializing to/from bytes) via kotlinx-io? |
Unfortunately, kotlinx-io project is indeed postponed at the time of writing. We still have a plan to provide API to interact with Java's Input/OutputStreams in 1.2 release |
Are you sure these tickets are connected? I think Spring wouldn't depend on (Beta) kotlinx-io until it is 1.0. And Spring also can use existing |
Actually tried to use kotlinx-io API just now and wondering if there's any progress on this after all this time? In the meantime, do you suggest we use okio directly for now? |
There's existing integration with okio (https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json-okio/kotlinx.serialization.json.okio/). Integration with kotlinx-io is being worked on right now and I expect it to be ready with next kotlinx.serialization release. |
That's amazing! I tried out the okio integration but it is really slow. I guess that has something to do with bytes / char conversion. Will that improve with kotlinx-io? |
Okio integration is usually fast when you use |
Noticed that the related PR is just adding integration with kotlinx.io for JSON format only. Will you continue adding integration for the core lib so that every format can get benefits from streaming en/decoding? |
If there is a significant demand for Protobuf or Cbor, we can add kotlinx-io to them as well. It is also easy to add corresponding signatures to |
@sandwwraith Given that the default implementation would be clearly making things worse I would think that it is better to have sub-interfaces that formats that actually properly support it can implement. At least that means that the it is clear when it is or is not supported. Especially as the whole point is to support more efficient reading/writing. |
Giving such default implementation does not help. The key classes in Json for streaming e.g. |
|
Or alternatively, provide an implementation of |
Btw. one missing bit is a common way to deal with encoding (think InputStreamReader). This functionality is needed for most textual formats (esp when they need to support non-utf encodings). |
@pdvrieze kotlinx-io may eventually support different charsets, although this task is currently not in priority |
Fixed by #2707 |
This will address:
#66, #204 and #251.
kotlinx.io.core.Input/Output
should replaceByteArray
s andString
s in Binary and String formats, thus allowing to work with streaming API and easily convert content to either byte arrays or strings with desired charsets.The text was updated successfully, but these errors were encountered: