外观
player_pump API
模块说明
text
Owned async observation pump. No event synthesis or cross-thread serialization.
The consumer supplies awaited install/apply callbacks. A domain must supervise
wait() alongside its Worker; close() joins actual callbacks before source release.PlayerPump
python
class PlayerPumpPlayerPump.__init__
python
def __init__(self, stream, epoch, apply)PlayerPump.open
python
@classmethod
async def open(cls, peer, session, *, install, apply, reader_options=None)SDK 说明:
text
Install the snapshot before starting. Callbacks must be async/cooperative.
Requires catalog poll_wait_ms support, checked here before opening a
source. install failure closes the acquired source; no reader is started.PlayerPump.wait
python
async def wait(self)SDK 说明:
text
Supervision hook: propagates read/apply failure; cancellation doesn't detach ownership.PlayerPump.close
python
async def close(self)SDK 说明:
text
Seal new polls, join the current read/apply, then release the stream.
Cancellation of this waiter does not cancel cleanup. Await close again to
observe actual completion; no drained acknowledgement is implied earlier.
A failed read/apply remains an error even when release succeeds.PlayerEventPump
python
class PlayerEventPump(PlayerPump)SDK 说明:
text
Owned mixed-event reader; apply is awaited for each Text or state event.
Callbacks receive (event, epoch=...). Preserve their order, including equal
state revisions. No startup queue or original-plugin dispatch is implied.
Inherits actual read/callback joining, supervision and source release.PlayerEventPump.__init__
python
def __init__(self, stream, epoch, apply)继承自 player_pump.PlayerPump.__init__。
PlayerEventPump.open
python
@classmethod
async def open(cls, peer, session, *, install, apply, reader_options=None)SDK 说明:
text
Install the snapshot before starting. Callbacks must be async/cooperative.
Requires catalog poll_wait_ms support, checked here before opening a
source. install failure closes the acquired source; no reader is started.继承自 player_pump.PlayerPump.open。
PlayerEventPump.wait
python
async def wait(self)SDK 说明:
text
Supervision hook: propagates read/apply failure; cancellation doesn't detach ownership.继承自 player_pump.PlayerPump.wait。
PlayerEventPump.close
python
async def close(self)SDK 说明:
text
Seal new polls, join the current read/apply, then release the stream.
Cancellation of this waiter does not cancel cleanup. Await close again to
observe actual completion; no drained acknowledgement is implied earlier.
A failed read/apply remains an error even when release succeeds.