Skip to content
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 a multiplatform okio.Closeable interface #870

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

swankjesse
Copy link
Collaborator

Not having it made interacting with Okio particularly annoying
on non-JVM platforms.

Note that we use our own use {} function on all platforms and do
not delegate to Kotlin's use {} function on the JVM. I couldn't
find a way to call Kotlin's use function from our own use function
since they both extend Closeable.

Copy link
Collaborator

@Egorand Egorand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dope!

@swankjesse swankjesse force-pushed the jwilson.0105.closeable branch 2 times, most recently from 22b50a2 to a912a81 Compare January 5, 2021 23:31
Not having it made interacting with Okio particularly annoying
on non-JVM platforms.

Note that we use our own use {} function on all platforms and do
not delegate to Kotlin's use {} function on the JVM. I couldn't
find a way to call Kotlin's use function from our own use function
since they both extend Closeable.
@swankjesse swankjesse force-pushed the jwilson.0105.closeable branch from a912a81 to cc815b8 Compare January 5, 2021 23:45
@@ -15,12 +15,15 @@
*/
package okio

actual interface Sink {
actual interface Sink : Closeable {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up having to put Sink back so the JVM one could keep the Flushable interface.

@swankjesse swankjesse merged commit 61913ce into master Jan 6, 2021
@swankjesse swankjesse deleted the jwilson.0105.closeable branch January 6, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants