mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
Add bot.job
as parent of NetworkHandlerSupport
This commit is contained in:
parent
5f7f350eb5
commit
c8def70594
@ -32,9 +32,11 @@ import kotlin.reflect.KClass
|
||||
* Implements basic logics of [NetworkHandler]
|
||||
*/
|
||||
internal abstract class NetworkHandlerSupport(
|
||||
override val context: NetworkHandlerContext,
|
||||
coroutineContext: CoroutineContext = EmptyCoroutineContext,
|
||||
) : NetworkHandler, CoroutineScope by coroutineContext.childScope(SupervisorJob()) {
|
||||
final override val context: NetworkHandlerContext,
|
||||
additionalCoroutineContext: CoroutineContext = EmptyCoroutineContext,
|
||||
) : NetworkHandler, CoroutineScope {
|
||||
final override val coroutineContext: CoroutineContext =
|
||||
additionalCoroutineContext.childScopeContext(SupervisorJob(context.bot.coroutineContext.job))
|
||||
|
||||
protected abstract fun initialState(): BaseStateImpl
|
||||
protected abstract suspend fun sendPacketImpl(packet: OutgoingPacket)
|
||||
|
Loading…
Reference in New Issue
Block a user