跳转到正文

player_observations API ​

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

模块说明 ​

text
Single-consumer, schema-validated player documents (not a Player reducer).

No background tasks or retry loop. Install/apply the returned document before
calling next(). On normal shutdown, await the in-flight operation before close().
Cancellation after IPC admission may seal the shared transport; it is exceptional
retirement, not normal stream cleanup. Worker shutdown remains the final owner if a transport failure prevents explicit close.

PlayerObservations ​

python
class PlayerObservations

SDK 说明:

text
Validated player document transport; state reconciliation is separate.

One encoded document <=32 MiB is assembled per operation. JSON parsing and
returned Python objects need additional memory; callers own returned values.
A failed/cancelled operation seals this client. Explicit close is still
allowed; a new subscription must reinstall its initial snapshot.

PlayerObservations.__init__ ​

python
def __init__(self, peer, session)

PlayerObservations.open ​

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

SDK 说明:

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

PlayerObservations.next ​

python
async def next(self)

SDK 说明:

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

PlayerObservations.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.

PlayerObservations.close ​

python
async def close(self)

SDK 说明:

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

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