okio icon indicating copy to clipboard operation
okio copied to clipboard

Explore coroutine-based API

Open Egorand opened this issue 6 years ago • 2 comments

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.

Egorand avatar Aug 30 '18 13:08 Egorand

@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 BufferedSources 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.

zach-klippenstein avatar Aug 30 '19 15:08 zach-klippenstein

Not sure where this exploration is currently at, but I've been exploring a coroutine-based API as well in a personal repository.

bnorm avatar Oct 02 '19 15:10 bnorm

No plans.

swankjesse avatar Feb 04 '24 19:02 swankjesse