跳转到正文

player_events API ​

完整接口目录 · 玩家查询用法 · 工具包下载

模块说明 ​

text
Ordered mixed state/Text documents, using the shared bounded transport.

Apply updates and deliver Text in returned order before reading again. Text does
not advance state revision; sequence identifies each event. No synthetic joins,
state projection, background task or retry is provided here.

validate_event ​

python
def validate_event(value)

SDK 说明:

text
Borrow and validate one event, including all decoded Text fields/caps.

PlayerEvents ​

python
class PlayerEvents(PlayerObservations)

SDK 说明:

text
Independent players.events grant, with shared hash/framing/close rules.

open returns (stream, initial snapshot); next/poll return mixed events.
A malformed event seals the client before advancing its applied cursor.

PlayerEvents.__init__ ​

python
def __init__(self, peer, session)

继承自 player_observations.PlayerObservations.__init__。

PlayerEvents.open ​

python
@classmethod
async def open(cls, peer, session, **options)

SDK 说明:

text
Return (stream, snapshot). Caller must close stream on every exit.

继承自 player_observations.PlayerObservations.open。

PlayerEvents.next ​

python
async def next(self)

SDK 说明:

text
Acknowledge the previously applied document, then read its successor.

继承自 player_observations.PlayerObservations.next。

PlayerEvents.poll ​

python
async def poll(self)

SDK 说明:

text
Return an update or None on idle; requires catalog poll_wait_ms support.

Idle retains the acknowledged cursor. No automatic polling loop or sleep.
The host limits source waiting to 100ms; encoding/transport are additional.

继承自 player_observations.PlayerObservations.poll。

PlayerEvents.close ​

python
async def close(self)

SDK 说明:

text
Await explicit release. Failure may be retried; no success is inferred.

继承自 player_observations.PlayerObservations.close。

Neomega · 使用、开发与参考文档