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

Switch OkHttpImagesPlugin to be Call.Factory-based #129

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

ZacSweers
Copy link

This is a binary-compatible change that changes the underlying semantics to use a Call.Factory rather than OkHttpClient directly. This allows for a few benefits:

  • Not tightly coupled to OkHttpClient
  • Allows for lazy/delegating/deferred initialization
  • Matches other OkHttpClient-dependent libraries' APIs, namely Retrofit and Apollo GraphQL

This is a binary-compatible change that changes the underlying semantics to use a Call.Factory rather than OkHttpClient directly. This allows for a few benefits:

- Not tightly coupled to OkHttpClient
- Allows for lazy/delegating/deferred initialization
- Matches other OkHttpClient-dependent libraries' APIs, namely Retrofit and Apollo GraphQL
@noties noties added this to the 3.1.0 milestone Jun 4, 2019
@noties noties changed the base branch from master to v3.1.0 June 4, 2019 12:16
@noties
Copy link
Owner

noties commented Jun 4, 2019

👍

@noties noties merged commit a501751 into noties:v3.1.0 Jun 4, 2019
@noties
Copy link
Owner

noties commented Jun 4, 2019

It was hard to notice in PR, but create(okHttpClient); without explicit cast to Call.Factory introduces stackoverflow because it is recursively calling itself

@ZacSweers
Copy link
Author

d'oh, good catch. Sounds like a good use case for tests :)

@ZacSweers ZacSweers deleted the z/callFactoryOkHttp branch June 4, 2019 15:36
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.

2 participants