Commit a08bf241 authored by Him188's avatar Him188

Improve event handler coroutine management

parent 9fdc8cd9
......@@ -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; })
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment