Skip to content

Conversation

@luanpotter
Copy link

Right now you cannot create a HttpConnectStrategy based off of an preexisting OkHttpClient. You can create one from scratch and then configure it with client configurers, but there is no way to base it off an existing OkHttpClient, which typically already exists on prior codebase for non-SSE calls.

This simple change just exposes the second constructor allowing users to use their existing, pre-configured OkHttpClient as seed for the SSE setup. That would otherwise not be possible with configurers without changing the entire codebase to use the SSE-specific configurer class, which is a hard sell.

This allows us to easily test and try out SSE calls within our existing okHttp infrastructure. I am sorry if this was already possible in some way I failed to see, and would appreciate some guidance instead.

@tanderson-ld
Copy link
Contributor

@luanpotter , thank you for reaching out. I'm going to take a look. My initial reaction is this breaks the encapsulation of the ConnectStrategy.http() API, but perhaps there is a way to provide a factory to make the OkHTTP instance that would be agreeable.

@luanpotter
Copy link
Author

Thanks for considering it @tanderson-ld , I understand the encapsulation concerns. Hopefully there is some way to make it possible to re-use an okHttp, but if not, I totally understand.

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