Skip to content

【实验性功能】asyncio支持 #1

@KBEngineLab

Description

@KBEngineLab

实验性功能

远程call支持 async ,如下:

async def fetch_data():
    await asyncio.sleep(2)  # 模拟I/O操作
    print("success")

系统回调:

⚠警告:请勿乱用async ,在不了解引擎执行顺序、async 原理、系统回调时机的情况下,禁止使用async ,会造成意想不到的BUG或系统负担

⚠警告:带有返回值的回调方法一律无法使用async ,切记!!

⚠警告:cellapp下,一切与时间、空间相关的回调请谨慎使用async ,会有时序问题

interfaces :

KBEngine:

  • onInterfaceAppReady
  • onRequestCreateAccount
  • onRequestAccountLogin
  • onRequestCharge
  • onInit
  • onInterfaceAppShutDown

base:

KBEngine:

  • onGlobalDataDel
  • onGlobalData
  • onBaseAppDataDel
  • onBaseAppData
  • onInit
  • onCellAppDeath
  • onLoseChargeCB
  • onAutoLoadEntityCreate
  • onBaseAppReady
  • onBaseAppShutDown
  • onReadyForLogin 不支持
  • onReadyForShutDown 不支持

Entity:

  • onDestroy
  • onCreateCellFailure
  • onGetCell
  • onClientDeath
  • onLoseCell
  • onRestore
  • onPreArchive 不支持
  • onWriteToDB
  • onTeleportFailure
  • onTeleportSuccess
  • onTimer

Proxy:

  • onClientEnabled
  • onLogOnAttempt 不支持
  • onClientDeath
  • onClientGetCell
  • onGiveClientToFailure
  • onStreamComplete

EntityComponent:

  • onAttached
  • onDetached

cell:

KBEngine:

  • onGlobalDataDel
  • onGlobalData
  • onCellAppDataDel
  • onCellAppData
  • onInit

Entity:

  • onDestroy
  • onSpaceGone
  • onWriteToDB
  • onWitnessed
  • onLoseControlledBy
  • onEnterTrap
  • onLeaveTrap
  • onEnteredView
  • onGetWitness
  • onLoseWitness
  • onMove
  • onMoveOver
  • onMoveFailure
  • onTurn
  • onTeleport
  • onTeleportFailure
  • onTeleportSuccess
  • onEnterSpace
  • onLeaveSpace
  • onEnteredCell
  • onEnteringCell
  • onLeavingCell
  • onLeftCell
  • onRestore
  • onTimer
  • onReadyForLogin 不支持
  • onSpaceGeometryLoaded
  • onAllSpaceGeometryLoaded
  • onSpaceData
  • onUpdateBegin
  • onUpdateEnd

login:

  • onLoginAppShutDown
  • onLoseLogin
  • onLoginAppReady
  • onRequestCreateAccount 不支持
  • onCreateAccountCallbackFromDB
  • onRequestLogin 不支持
  • onLoginCallbackFromDB

bots:

  • onInit
  • onFinish

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions