Skip to content

Commit

Permalink
Use coroutine scope insteand of using runBlocking for rejoining
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Jan 3, 2025
1 parent d35dea4 commit b976ad1
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.retry
import kotlinx.coroutines.flow.retryWhen
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
Expand Down Expand Up @@ -1729,7 +1728,7 @@ public class RtcSession internal constructor(
}
}

private suspend fun parseError(e: Throwable): Failure {
private fun parseError(e: Throwable): Failure {
return Failure(
io.getstream.result.Error.ThrowableError(
"CallClientImpl error needs to be handled",
Expand Down Expand Up @@ -1909,11 +1908,11 @@ public class RtcSession internal constructor(
stateJob?.cancel()
eventJob?.cancel()
errorJob?.cancel()
runBlocking {
coroutineScope.launch {
sfuConnectionModule.socketConnection.disconnect()
publisher?.connection?.close()
subscriber?.connection?.close()
}
publisher?.connection?.close()
subscriber?.connection?.close()
}

internal fun prepareReconnect() {
Expand Down

0 comments on commit b976ad1

Please sign in to comment.