apollo-kotlin
apollo-kotlin copied to clipboard
Deprecate `dispose()` methods and instead implement `okio.Closeable`
Use case
If types implement okio.Closeable, then you can use okio.use to make sure they get closed reliably.
Describe the solution you'd like
Implement something similar to https://github.com/apollographql/apollo-kotlin/pull/4142 for all types that currently have a dispose() function.
Is there a preference for doing the refactoring in a single PR for all types or doing a separate PR for each type that should implement okio.Closeable ?
Thank you for looking into this 🙏 I'd say a single PR would probably be the best for this.
Had a look at it but it looks like all the other cases are on interfaces - that makes it difficult as it is a breaking change to add methods on interfaces. Adding an item on the 4.0 changes ticket instead.
I think MockServer has a stop too that could be done now. It'd be especially useful because it's often used with ApolloClient in tests
I just realized that MockServer.stop is suspend (due to the JS version) so Closeable is not applicable 😞
Closing as this was done in #5307 and available in v4.0.0-beta.2