外观
bus_events API
模块说明
text
Typed, staged event declarations; validation never calls business code.SourceContext
python
@dataclass(frozen=True)
class SourceContext字段(包含继承字段):
SourceContext.publisher_id
python
publisher_id: str数据类字段;声明于 bus_events.SourceContext。
SourceContext.publisher
python
publisher: Identity数据类字段;声明于 bus_events.SourceContext。
SourceContext.member
python
member: str数据类字段;声明于 bus_events.SourceContext。
SourceContext.major
python
major: int数据类字段;声明于 bus_events.SourceContext。
SourceContext.schema_digest
python
schema_digest: str数据类字段;声明于 bus_events.SourceContext。
SourceContext.cancelled
python
@property
def cancelled(self)EventContext
python
@dataclass(frozen=True)
class EventContextSDK 说明:
text
Host-attested online event metadata, never copied from business values.字段(包含继承字段):
EventContext.sequence
python
sequence: int数据类字段;声明于 bus_events.EventContext。
EventContext.publisher_id
python
publisher_id: str | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.publisher
python
publisher: Identity | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.member
python
member: str | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.major
python
major: int | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.schema_digest
python
schema_digest: str | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.accepted_at
python
accepted_at: datetime | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.packet_id
python
packet_id: int | None = None数据类字段;声明于 bus_events.EventContext。
EventContext.connection_id
python
connection_id: str | None = None数据类字段;声明于 bus_events.EventContext。
StreamStatus
python
@dataclass(frozen=True)
class StreamStatusSDK 说明:
text
One current-generation snapshot; only an explicit pause may resume.字段(包含继承字段):
StreamStatus.index
python
index: int数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.kind
python
kind: str数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.state
python
state: str数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.member
python
member: str | None = None数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.major
python
major: int | None = None数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.packet_id
python
packet_id: int | None = None数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.reason
python
reason: str | None = None数据类字段;声明于 bus_events.StreamStatus。
StreamStatus.gap
python
gap: bool = False数据类字段;声明于 bus_events.StreamStatus。
event_options
python
def event_options(name, major)SourceRegistration
python
class SourceRegistrationSourceRegistration.__init__
python
def __init__(self, registry, key, handler, *, name, major=1, unique=True)SourceRegistration.descriptor
python
@property
def descriptor(self)SourceRegistration.create
python
def create(self, context)SourceRegistration.close
python
def close(self)SourceRegistration.binding
python
self.binding公开实例属性,在 __init__ 中设置。
SourceRegistration.handler
python
self.handler公开实例属性,在 __init__ 中设置。
SourceRegistration.member
python
self.member公开实例属性,在 __init__ 中设置。
SourceRegistration.major
python
self.major公开实例属性,在 __init__ 中设置。
EventRegistration
python
class EventRegistrationEventRegistration.__init__
python
def __init__(
self,
handler,
*,
asynchronous,
member = None,
major = 1,
packet_type = None,
max_events = 256,
max_bytes = 512 << 10,
)EventRegistration.arguments
python
def arguments(self, value, context)EventRegistration.binding
python
self.binding公开实例属性,在 __init__ 中设置。
EventRegistration.handler
python
self.handler公开实例属性,在 __init__ 中设置。
EventRegistration.asynchronous
python
self.asynchronous公开实例属性,在 __init__ 中设置。
EventRegistration.member
python
self.member公开实例属性,在 __init__ 中设置。
EventRegistration.major
python
self.major公开实例属性,在 __init__ 中设置。
EventRegistration.packet_type
python
self.packet_type公开实例属性,在 __init__ 中设置。
EventRegistration.max_events
python
self.max_events公开实例属性,在 __init__ 中设置。
EventRegistration.max_bytes
python
self.max_bytes公开实例属性,在 __init__ 中设置。
bus_publish
python
def bus_publish(name, *, major=1, unique=True)on_bus_data
python
def on_bus_data(name, **options)on_bus_data_async
python
def on_bus_data_async(name, **options)on_packet
python
def on_packet(packet_type, **options)on_packet_async
python
def on_packet_async(packet_type, **options)