mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
fixes of deprecates
This commit is contained in:
parent
9566d6f81f
commit
2020e48659
@ -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())
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user