mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 15:49:15 +08:00
Improve event handler coroutine management
This commit is contained in:
parent
9fdc8cd929
commit
a08bf241ed
@ -29,8 +29,8 @@ internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(
|
||||
): Listener<E> {
|
||||
return this.kotlin.subscribeInternal(
|
||||
scope.Handler(
|
||||
EmptyCoroutineContext,
|
||||
Listener.ConcurrencyKind.CONCURRENT
|
||||
scope.coroutineContext,
|
||||
Listener.ConcurrencyKind.LOCKED
|
||||
) { withContext(Dispatchers.IO) { onEvent.apply(it) } })
|
||||
}
|
||||
|
||||
@ -39,6 +39,6 @@ internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(scope: CoroutineSco
|
||||
return this.kotlin.subscribeInternal(
|
||||
scope.Handler(
|
||||
EmptyCoroutineContext,
|
||||
Listener.ConcurrencyKind.CONCURRENT
|
||||
Listener.ConcurrencyKind.LOCKED
|
||||
) { withContext(Dispatchers.IO) { onEvent.accept(it) }; ListeningStatus.LISTENING; })
|
||||
}
|
Loading…
Reference in New Issue
Block a user