外观
views API
模块说明
text
Typed atomic views with bounded, independently owned Watch deliveries.S
python
S = TypeVar('S')D
python
D = TypeVar('D')ViewSnapshot
python
@dataclass(frozen=True)
class ViewSnapshot(Generic[S])字段(包含继承字段):
ViewSnapshot.instance
python
instance: Identity数据类字段;声明于 views.ViewSnapshot。
ViewSnapshot.epoch
python
epoch: str数据类字段;声明于 views.ViewSnapshot。
ViewSnapshot.revision
python
revision: int数据类字段;声明于 views.ViewSnapshot。
ViewSnapshot.complete
python
complete: bool数据类字段;声明于 views.ViewSnapshot。
ViewSnapshot.reason
python
reason: str数据类字段;声明于 views.ViewSnapshot。
ViewSnapshot.snapshot
python
snapshot: S数据类字段;声明于 views.ViewSnapshot。
另继承外部类型 Generic[S];其通用方法不在本 SDK 目录中重复展开。
ViewDelta
python
@dataclass(frozen=True)
class ViewDelta(Generic[D])字段(包含继承字段):
ViewDelta.instance
python
instance: Identity数据类字段;声明于 views.ViewDelta。
ViewDelta.epoch
python
epoch: str数据类字段;声明于 views.ViewDelta。
ViewDelta.revision
python
revision: int数据类字段;声明于 views.ViewDelta。
ViewDelta.complete
python
complete: bool数据类字段;声明于 views.ViewDelta。
ViewDelta.reason
python
reason: str数据类字段;声明于 views.ViewDelta。
ViewDelta.delta
python
delta: D数据类字段;声明于 views.ViewDelta。
另继承外部类型 Generic[D];其通用方法不在本 SDK 目录中重复展开。
ViewUpdate
python
@dataclass(frozen=True)
class ViewUpdate(Generic[S, D])字段(包含继承字段):
ViewUpdate.kind
python
kind: str数据类字段;声明于 views.ViewUpdate。
ViewUpdate.instance
python
instance: Identity数据类字段;声明于 views.ViewUpdate。
ViewUpdate.epoch
python
epoch: str数据类字段;声明于 views.ViewUpdate。
ViewUpdate.revision
python
revision: int数据类字段;声明于 views.ViewUpdate。
ViewUpdate.complete
python
complete: bool数据类字段;声明于 views.ViewUpdate。
ViewUpdate.reason
python
reason: str数据类字段;声明于 views.ViewUpdate。
ViewUpdate.snapshot
python
snapshot: S | None = None数据类字段;声明于 views.ViewUpdate。
ViewUpdate.delta
python
delta: D | None = None数据类字段;声明于 views.ViewUpdate。
另继承外部类型 Generic[S, D];其通用方法不在本 SDK 目录中重复展开。
Watch
python
class Watch(Generic[S, D])SDK 说明:
text
One atomic baseline and ordered deltas; close waits for actual cleanup.
``valid`` is false for incomplete sources and after any discontinuity.
An incomplete baseline may be displayed as observations, never as an exact
roster. Completeness cannot become true without explicitly opening again.
Each Watch buffers at most 32 deltas / 8 MiB; overflow seals only this Watch.Watch.__init__
python
def __init__(self, owner, options)Watch.initial
python
@property
def initial(self)Watch.valid
python
@property
def valid(self)Watch.reason
python
@property
def reason(self)Watch.read
python
async def read(self)SDK 说明:
text
Wait for one delta. A failed source invalidates queued local data.Watch.__aiter__
python
def __aiter__(self)Watch.__anext__
python
async def __anext__(self)Watch.__aenter__
python
async def __aenter__(self)Watch.__aexit__
python
async def __aexit__(self, *exc)Watch.close
python
async def close(self)另继承外部类型 Generic[S, D];其通用方法不在本 SDK 目录中重复展开。
WatchRegistration
python
class WatchRegistrationWatchRegistration.__init__
python
def __init__(self, owner, callback, options, asynchronous)WatchRegistration.error
python
self.error公开实例属性,在 __init__、_run 中设置。
WatchRegistry
python
class WatchRegistrySDK 说明:
text
Plugin-owned scope: freeze candidates, explicitly activate each run.WatchRegistry.__init__
python
def __init__(self, bus)WatchRegistry.declared
python
@property
def declared(self)WatchRegistry.register
python
def register(
self,
member,
*,
snapshot_type,
delta_type,
major = 1,
provider = None,
asynchronous,
)WatchRegistry.freeze
python
def freeze(self)WatchRegistry.watch
python
async def watch(self, member, *, snapshot_type, delta_type, major=1, provider=None)WatchRegistry.activate
python
def activate(self, token)WatchRegistry.seal
python
def seal(self)WatchRegistry.begin_join
python
def begin_join(self)WatchRegistry.join
python
async def join(self)