We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 533a163 commit 45f417eCopy full SHA for 45f417e
apollo-coroutines-support/src/main/kotlin/com/apollographql/apollo/coroutines/CoroutinesExtensions.kt
@@ -13,9 +13,8 @@ import kotlinx.coroutines.flow.*
13
14
private class ChannelCallback<T>(val channel: Channel<Response<T>>) : ApolloCall.Callback<T>() {
15
16
- @ExperimentalCoroutinesApi
17
override fun onResponse(response: Response<T>) {
18
- if (!channel.isClosedForSend) {
+ runCatching {
19
channel.offer(response)
20
}
21
@@ -196,7 +195,9 @@ fun <T> ApolloSubscriptionCall<T>.toChannel(capacity: Int = Channel.UNLIMITED):
196
195
197
198
199
- channel.offer(response)
+ channel.offer(response)
200
+ }
201
202
203
override fun onFailure(e: ApolloException) {
0 commit comments