gildor / kotlin-coroutines-okhttp

Kotlin Coroutines await() extension for OkHttp Call
Apache License 2.0
184 stars 14 forks source link

Suspendable extensions for web sockets #1

Open mykola-dev opened 6 years ago

mykola-dev commented 6 years ago

OkHttp supports web sockets since 3.5. It would be nice to have some suspendable websockets helpers too

gildor commented 6 years ago

Hi. I have a couple experimental implementation, but after playing with it I'm not sure about correct API. The most idiomatic way is to wrap each response to sealed class with state and send it a channel, but it also adds some overhead. Some other implementations actually not so much better than standard OkHttp API. Do you have some ideas about API that would be useful for you?