外观
bus_registry API
模块说明
text
Annotation-derived staging registrations for the native read/service Bus.BusError
python
class BusError(RuntimeError)SDK 说明:
text
An explicit terminal Bus failure; callers never replay it automatically.BusError.__init__
python
def __init__(self, code)另继承外部类型 RuntimeError;其通用方法不在本 SDK 目录中重复展开。
BusError.bus_code
python
self.bus_code公开实例属性,在 __init__ 中设置。
BusError.code
python
self.code公开实例属性,在 __init__ 中设置。
Identity
python
@dataclass(frozen=True)
class Identity字段(包含继承字段):
Identity.installation
python
installation: str数据类字段;声明于 bus_registry.Identity。
Identity.generation
python
generation: int数据类字段;声明于 bus_registry.Identity。
Call
python
@dataclass(frozen=True)
class CallSDK 说明:
text
Host-authenticated invocation metadata, separate from business data.
arguments_raw is a validated canonical tagged request in immutable UTF-8
bytes. It never supplies identity or authorization claims.字段(包含继承字段):
Call.call_id
python
call_id: str数据类字段;声明于 bus_registry.Call。
Call.caller
python
caller: Identity数据类字段;声明于 bus_registry.Call。
Call.provider
python
provider: Identity数据类字段;声明于 bus_registry.Call。
Call.accepted_at
python
accepted_at: datetime数据类字段;声明于 bus_registry.Call。
Call.deadline
python
deadline: datetime数据类字段;声明于 bus_registry.Call。
Call.member
python
member: str数据类字段;声明于 bus_registry.Call。
Call.kind
python
kind: str数据类字段;声明于 bus_registry.Call。
Call.major
python
major: int数据类字段;声明于 bus_registry.Call。
Call.schema_digest
python
schema_digest: str数据类字段;声明于 bus_registry.Call。
Call.arguments_raw
python
arguments_raw: bytes数据类字段;声明于 bus_registry.Call。
Call.scope_id
python
scope_id: str | None = None数据类字段;声明于 bus_registry.Call。
Call.session_id
python
session_id: str | None = None数据类字段;声明于 bus_registry.Call。
Call.cancelled
python
@property
def cancelled(self)EmptyRequest
python
@dataclass(frozen=True)
class EmptyRequestSDK 说明:
text
Structural request type of a callable with no business arguments.bus_service
python
def bus_service(name, *, major=1, shared=False)SDK 说明:
text
Declare a Plugin method; context injection depends on the Call type.bus_read
python
def bus_read(name, *, major=1, shared=False, candidate_readable=False)Registration
python
class RegistrationRegistration.__init__
python
def __init__(self, registry, key, handler, options)Registration.descriptor
python
@property
def descriptor(self)Registration.close
python
def close(self)SDK 说明:
text
Remove a registration during on_init, before validation freezes it.Registration.invoke
python
async def invoke(self, body, argument)Registration.signature
python
self.signature公开实例属性,在 __init__ 中设置。
Registration.request_type
python
self.request_type公开实例属性,在 __init__ 中设置。
BusRegistry
python
class BusRegistryBusRegistry.__init__
python
def __init__(self)BusRegistry.provide
python
def provide(
self,
handler,
*,
name,
kind = 'service',
major = 1,
shared = False,
candidate_readable = False,
)BusRegistry.service
python
def service(self, name, *, major=1, shared=False)BusRegistry.read
python
def read(self, name, *, major=1, shared=False, candidate_readable=False)BusRegistry.publish
python
def publish(self, name, *, major=1, unique=True)BusRegistry.on_bus_data
python
def on_bus_data(self, name, **options)BusRegistry.on_bus_data_async
python
def on_bus_data_async(self, name, **options)BusRegistry.on_packet
python
def on_packet(self, packet_type, **options)BusRegistry.on_packet_async
python
def on_packet_async(self, packet_type, **options)BusRegistry.freeze
python
def freeze(self)BusRegistry.invoke
python
async def invoke(self, body, argument)