跳转到正文

bus_ops API ​

完整接口目录 · 插件运行时用法 · 工具包下载

模块说明 ​

text
Durable Bus admissions; never wait for, cancel, or replay world actions.

OpIntent ​

python
@dataclass(frozen=True)
class OpIntent

SDK 说明:

text
Caller-owned admission metadata, including the original fixed deadline.

Retain the target, arguments, contract and provider alongside this value
before calling when reconciliation must survive worker exit. Construction
performs no IO and freezes the current causal parent. Reuse this instance
for retries; an expired deadline is never silently renewed.

字段(包含继承字段):

OpIntent.idempotency_key ​

python
idempotency_key: str

数据类字段;声明于 bus_ops.OpIntent。

OpIntent.session ​

python
session: str

数据类字段;声明于 bus_ops.OpIntent。

OpIntent.deadline ​

python
deadline: str

数据类字段;声明于 bus_ops.OpIntent。

该类型另有以下内部字段,参与数据类声明但不建议直接读写;创建对象时优先使用专题中的工厂方法:

python
_cause: str | None = field(default_factory=_current_cause.get, init=False, repr=False, compare=False)
_scope: str | None = field(default_factory=_current_scope.get, init=False, repr=False, compare=False)
_scope_session: str | None = field(default_factory=_current_scope_session.get, init=False, repr=False, compare=False)

OpIntent.payload ​

python
def payload(self)

OpAdmission ​

python
@dataclass(frozen=True)
class OpAdmission

SDK 说明:

text
Durable acceptance only, including duplicates in any retained state.

字段(包含继承字段):

OpAdmission.operation_id ​

python
operation_id: str

数据类字段;声明于 bus_ops.OpAdmission。

OpAdmission.state ​

python
state: str

数据类字段;声明于 bus_ops.OpAdmission。

OpAdmission.expires_at ​

python
expires_at: str

数据类字段;声明于 bus_ops.OpAdmission。

OpAdmission.duplicate ​

python
duplicate: bool

数据类字段;声明于 bus_ops.OpAdmission。

OpAdmission.scheduling_pending ​

python
scheduling_pending: bool

数据类字段;声明于 bus_ops.OpAdmission。

OpAdmission.from_payload ​

python
@classmethod
def from_payload(cls, value)

SDK 说明:

text
Validate the plain admission JSON independently of the tagged codec.

OpAdmissionError ​

python
class OpAdmissionError(BusError)

SDK 说明:

text
Admission cannot be established; retain the exact request for reconciliation.

OpAdmissionError.__init__ ​

python
def __init__(self, code, intent, operation_id=None, request=None)

OpAdmissionError.intent ​

python
self.intent

公开实例属性,在 __init__ 中设置。

OpAdmissionError.operation_id ​

python
self.operation_id

公开实例属性,在 __init__ 中设置。

OpAdmissionError.request ​

python
self.request

公开实例属性,在 __init__ 中设置。

OpAdmissionTimeout ​

python
class OpAdmissionTimeout(TimeoutError)

SDK 说明:

text
Local waiting expired; any known operation remains retained and uncancelled.

OpAdmissionTimeout.__init__ ​

python
def __init__(self, intent, operation_id=None, request=None, rejection_code=None)

另继承外部类型 TimeoutError;其通用方法不在本 SDK 目录中重复展开。

OpAdmissionTimeout.intent ​

python
self.intent

公开实例属性,在 __init__ 中设置。

OpAdmissionTimeout.operation_id ​

python
self.operation_id

公开实例属性,在 __init__ 中设置。

OpAdmissionTimeout.request ​

python
self.request

公开实例属性,在 __init__ 中设置。

OpAdmissionTimeout.rejection_code ​

python
self.rejection_code

公开实例属性,在 __init__ 中设置。

op_context ​

python
def op_context(error: BaseException) -> tuple[OpIntent | None, str | None]

SDK 说明:

text
Read reconciliation context, including Python 3.10 task cancellation chains.

op_request ​

python
def op_request(error: BaseException) -> dict | None

SDK 说明:

text
Recover the complete tagged request even across task cancellation wrappers.

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