mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-23 00:57:15 +00:00
commit
65e339f811
@ -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())
|
||||
}
|
||||
|
@ -46,4 +46,4 @@ dokka_version=1.4.32
|
||||
|
||||
group=dev.inmo
|
||||
version=0.5.4
|
||||
android_code_version=44
|
||||
android_code_version=45
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user