fixes of deprecates

This commit is contained in:
InsanusMokrassar 2021-05-26 22:33:08 +06:00
parent 9566d6f81f
commit 2020e48659
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ inline fun CoroutineScope.createSafeActionsActor(
suspend fun <T> Channel<suspend () -> Unit>.doWithSuspending(
action: ActorAction<T>
) = suspendCoroutine<T> {
offer {
trySend {
safely({ e -> it.resumeWithException(e) }) {
it.resume(action())
}

View File

@ -10,7 +10,7 @@ import kotlinx.coroutines.flow.collect
import kotlinx.serialization.SerializationStrategy
private suspend fun DefaultWebSocketSession.checkReceivedAndCloseIfExists() {
if (incoming.poll() != null) {
if (incoming.tryReceive() != null) {
close()
throw CorrectCloseException
}