Merge pull request #68 from InsanusMokrassar/0.5.4

0.5.4
This commit is contained in:
2021-05-26 22:33:53 +06:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

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

View File

@@ -46,4 +46,4 @@ dokka_version=1.4.32
group=dev.inmo group=dev.inmo
version=0.5.4 version=0.5.4
android_code_version=44 android_code_version=45

View File

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