mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-12 14:00:12 +08:00
[core/common] Process packet body in launched coroutines, instead of suspending the processing queue. part of #2160.
This commit is contained in:
parent
9dd57de844
commit
e6bef9ce1e
@ -121,7 +121,7 @@ internal abstract class CommonNetworkHandler<Conn>(
|
|||||||
result.getOrNull()?.let { packet ->
|
result.getOrNull()?.let { packet ->
|
||||||
try {
|
try {
|
||||||
val decoded = decodePacket(packet)
|
val decoded = decodePacket(packet)
|
||||||
processBody(decoded)
|
launch(start = CoroutineStart.UNDISPATCHED) { processBody(decoded) }
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
if (e is CancellationException) return@launch
|
if (e is CancellationException) return@launch
|
||||||
handleExceptionInDecoding(e)
|
handleExceptionInDecoding(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user