okio
okio copied to clipboard
Explore coroutine-based API
Coroutines will graduate to stable in Kotlin 1.3, which is currently in pre-release stages. We need a design doc on how Okio will be using coroutines and start sketching out the API.
@swankjesse started a proof-of-concept using NIO's async API in #531, and there's a ton of discussion there. That proposal adds non-blocking variants to only the basic read/write APIs - processing data using BufferedSource
s full API would require first filling the buffer manually using one of the non-blocking methods, and refilling it as necessary when consumed. I'm not sure how writing would work, since blocking BufferedSink
calls will always try to write completed segments before returning, so requiring the caller to always remember to make explicit non-blocking emit calls is kind of awkward.
Not sure where this exploration is currently at, but I've been exploring a coroutine-based API as well in a personal repository.
No plans.